#8886: loaddata deserializes BooleanFields wrong for inheriting model
-------------------------------------+-------------------------------------
     Reporter:  erichs@…             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  1.0
  (models, ORM)                      |               Resolution:  fixed
     Severity:  Normal               |             Triage Stage:  Design
     Keywords:  loaddata             |  decision needed
  BooleanField                       |      Needs documentation:  0
    Has patch:  0                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by aaugustin):

 * status:  new => closed
 * ui_ux:   => 0
 * resolution:   => fixed
 * easy:   => 0


Comment:

 The example provided by the OP now properly raises a `ValidationError`:
 {{{
 Traceback (most recent call last):
   File "./manage.py", line 9, in <module>
     execute_from_command_line(sys.argv)
   File "/Users/myk/Documents/dev/django-
 trunk/django/core/management/__init__.py", line 422, in
 execute_from_command_line
     utility.execute()
   File "/Users/myk/Documents/dev/django-
 trunk/django/core/management/__init__.py", line 361, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/Users/myk/Documents/dev/django-
 trunk/django/core/management/base.py", line 192, in run_from_argv
     self.execute(*args, **options.__dict__)
   File "/Users/myk/Documents/dev/django-
 trunk/django/core/management/base.py", line 228, in execute
     output = self.handle(*args, **options)
   File "/Users/myk/Documents/dev/django-
 trunk/django/core/management/base.py", line 364, in handle
     return self.handle_noargs(**options)
   File "/Users/myk/Documents/dev/django-
 trunk/django/core/management/commands/validate.py", line 9, in
 handle_noargs
     self.validate(display_num_errors=True)
   File "/Users/myk/Documents/dev/django-
 trunk/django/core/management/base.py", line 262, in validate
     num_errors = get_validation_errors(s, app)
   File "/Users/myk/Documents/dev/django-
 trunk/django/core/management/validation.py", line 30, in
 get_validation_errors
     for (app_name, error) in get_app_errors().items():
   File "/Users/myk/Documents/dev/django-
 trunk/django/db/models/loading.py", line 158, in get_app_errors
     self._populate()
   File "/Users/myk/Documents/dev/django-
 trunk/django/db/models/loading.py", line 64, in _populate
     self.load_app(app_name, True)
   File "/Users/myk/Documents/dev/django-
 trunk/django/db/models/loading.py", line 88, in load_app
     models = import_module('.models', app_name)
   File "/Users/myk/Documents/dev/django-trunk/django/utils/importlib.py",
 line 35, in import_module
     __import__(name)
   File "/Users/myk/Documents/dev/test_project/test_app/models.py", line
 22, in <module>
     class Employee(User):
   File "/Users/myk/Documents/dev/django-trunk/django/db/models/base.py",
 line 149, in __new__
     (field.name, name, base.__name__))
 django.core.exceptions.FieldError: Local field 'is_active' in class
 'Employee' clashes with field of similar name from base class 'User'
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/8886#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to