#14820: Use `TextField` instead of `PositiveIntegerField` in docs and examples
for
generic relations.
------------------------------------+---------------------------------------
Reporter: mrmachine | Owner:
Status: new | Milestone: 1.3
Component: Documentation | Version: SVN
Resolution: | Keywords: generic relation
genericforeignkey object_id type textfield sprintdec2010
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
------------------------------------+---------------------------------------
Changes (by mrmachine):
* keywords: generic relation genericforeignkey object_id type textfield
=> generic relation genericforeignkey
object_id type textfield sprintdec2010
* needs_better_patch: 1 => 0
Comment:
I've updated the patch as per your feedback. I don't have the setup to
compile the docs and view the resulting HTML version, so I'm not 100%
certain that I've formatted it correctly with regards to the `admonition`
and `versionchanged` directives.
I changed the example to use `IntegerField` instead of
`PositiveIntegerField` because the default for models is actually
`IntegerField`, and `PositiveIntegerField` just adds some extra validation
to that which isn't really relevant here.
I also use `CharField` in the the example scenario, as I believe it should
not have the same database performance issues as `TextField` while still
offering compatibility with integer and character primary keys, but also
still mention that `TextField` provides maximum flexibility when you don't
know which models will be related to yours, but with `TextField` comes the
performance considerations you mentioned.
--
Ticket URL: <http://code.djangoproject.com/ticket/14820#comment:9>
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.