Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin errorlist not shown in case of validation error #46

Closed
esistgut opened this issue May 25, 2014 · 4 comments
Closed

Admin errorlist not shown in case of validation error #46

esistgut opened this issue May 25, 2014 · 4 comments
Assignees
Labels

Comments

@esistgut
Copy link

Relevant snippet from the model:

class Language(models.Model):
    driver = models.ForeignKey('Driver')
    data = hstore.DictionaryField()

    objects = hstore.HStoreManager()

class Driver(models.Model):
    name = models.CharField(max_length=255)
    surname = models.CharField(max_length=255)

relevant part from the admin:

class LangInline(admin.StackedInline):
    max_num = 1
    extra = 1
    model = models.Language

admin.site.register(models.Driver, inlines=(LangInline,))

If I try to save a new driver without adding any row to the "data" field it fails saying "Please correct the error below." but no error is printed.
If I add a row to the field the Driver and Language models are created but then If I try to remove the Language model from the Driver's admin page I get the message "Please correct the error below." again.

@esistgut
Copy link
Author

If I set a default value for the field

data = hstore.DictionaryField(default={})

it works as I expect.
Is this the correct way? Am I missing something?

@nemesifier
Copy link
Member

could you debug with the javascript console and see what is sent to the server?

Are you using the default admin template? With which version of django?

@niwinz niwinz added the bug label Jun 18, 2014
@nemesifier
Copy link
Member

hey @esistgut could you answer my questions?

@esistgut
Copy link
Author

Hi, sorry for the late answer. I can't help you with the actual debugging anymore because we are no longer using hstore and we dropped django-hstore out of our dependencies.
I was using the latest stable release (1.6.x) with the default admin template.

@nemesifier nemesifier changed the title Can't use DictionaryField in a StackedInline model Admin errorlist not shown when there is a validation error related to an django_hstore field Jun 23, 2014
@nemesifier nemesifier changed the title Admin errorlist not shown when there is a validation error related to an django_hstore field Admin errorlist not shown in case of validation error Jun 23, 2014
@nemesifier nemesifier self-assigned this Jun 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants