#13803: Model attribute cannot be named pk and set primary_key=True
-------------------------------------+-------------------------------------
               Reporter:  jonknee    |          Owner:  hjeffrey
                   Type:  Bug        |         Status:  assigned
              Milestone:  1.3        |      Component:  Database layer
                Version:  SVN        |  (models, ORM)
             Resolution:             |       Severity:  Normal
           Triage Stage:  Accepted   |       Keywords:
    Needs documentation:  0          |      Has patch:  1
Patch needs improvement:  1          |    Needs tests:  1
                                     |  Easy pickings:  0
-------------------------------------+-------------------------------------
Changes (by lukeplant):

 * needs_better_patch:  0 => 1
 * needs_tests:  0 => 1
 * easy:   => 0
 * stage:  Ready for checkin => Accepted


Comment:

 This is the wrong place to put the check, since it will only trigger when
 the table is created by syncdb, which is not a necessary step for using a
 Django model. It should probably be in
 django/core/management/validation.py, with tests in
 modeltests/invalid_models/models.py

 Also, `AttributeError` would certainly not be the right exception to raise
 - http://docs.python.org/library/exceptions.html#exceptions.AttributeError

 By the way, you should not normally set 'Ready for checkin' yourself, but
 rather get someone else to review your patch and set that.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13803#comment:7>
Django <http://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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to