#13777: problems using **kwargs to create an instance of a model with an
AutoField
primary key
---------------------------------------------------+------------------------
Reporter: seth_a | Owner: nobody
Status: closed | Milestone:
Component: Database layer (models, ORM) | Version: 1.2
Resolution: worksforme | Keywords: **kwargs,
AutoField
Stage: Unreviewed | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Changes (by russellm):
* status: new => closed
* needs_better_patch: => 0
* resolution: => worksforme
* needs_tests: => 0
* needs_docs: => 0
Comment:
I can't reproduce this. Logically, it doesn't make much sense, either:
Klass(data=foo) and Klass(**{'data':foo}) are identical at the language
parsing level, and neither should have any effect on the metaclass (which
is where the class it constructed), since you're dealing with the __init__
method when you create an instance.
I suspect you have some other error of usage; please follow this up on
django-users.
Also, as a minor stylistic thing: According to PEP8, class names should be
capitalized (Simple, not simple).
--
Ticket URL: <http://code.djangoproject.com/ticket/13777#comment:1>
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.