#14403 closed (fixed)
Missing/incomplete documentation for FloatField?
Reported by: | Owned by: | Robert Lujo | |
---|---|---|---|
Component: | Documentation | Version: | 1.2 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
http://docs.djangoproject.com/en/dev/ref/models/fields/#floatfield
There is no description of options for model floatfields.
It invites people to read the release notes for 1.0 for changes, but there is no description of what changed as far as I can see.
Attachments (3)
Change History (16)
comment:1 by , 14 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 14 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
This makes sense. Thank you.
Actually, after writing this ticket, I found out that I was thinking of DecimalField which has documented options. I got it confused with FloatField.
Since these are somewhat similar, perhaps they can refer to each other since they don't appear closely together in the docs. Kind of like how BigIntegerField refers to IntegerField.
follow-up: 4 comment:3 by , 14 years ago
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
The field classes in that document are listed in alphabetical order rather than by type or similarity. This issue has actually come up before though I can't find the ticket currently. The core of the decision is that things in the Reference section of the docs are meant to be comprehensive listings (which should be ordered alphabetically) rather than guided overviews (which would be better grouped by topic, and hence are in the Topics section).
While I realize that many people come to the Reference section without realizing what they're looking at, without a major reorganization and restructuring of the docs, this isn't an issue which will be fixed.
Ultimately, DecimalField
and FloatField
aren't actually that related from a Python standpoint. To us mere humans they both store numbers with decimal points in them, but to computers they're very different.
I hope that all makes sense, and thanks for the report!
comment:4 by , 14 years ago
Replying to gabrielhurley:
Ultimately,
DecimalField
andFloatField
aren't actually that related from a Python standpoint. To us mere humans they both store numbers with decimal points in them, but to computers they're very different.
Documentation is for humans. This paragraph is an excellent argument for the cross-link and clarification requested in the reopen, not against it. When two things that seem superficially similar to the newbie are actually quite different underneath, that's what docs are for.
comment:5 by , 14 years ago
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
Triage Stage: | Unreviewed → Accepted |
I suppose that's fair; though what needs to be understood is actually a Python issue, not a Django issue. I'll accept that we could offer some guidance on the topic.
Perhaps just a link to the Decimal module's comparison of Decimal vs. float in the Python docs, linked from both DecimalField and FloatField, would suffice? I don't see it as beneficial to try and explain the difference between a float and a Decimal within the ModelField Reference.
comment:6 by , 14 years ago
Owner: | changed from | to
---|---|
Status: | reopened → new |
comment:7 by , 14 years ago
Status: | new → assigned |
---|
by , 14 years ago
Attachment: | 14403_decimalFloat.2.diff added |
---|
models/fields.txt - distinction between float and decimal
by , 14 years ago
Attachment: | 14403_decimalFloat.diff added |
---|
models/fields.txt - distinction between float and decimal
comment:8 by , 14 years ago
Has patch: | set |
---|
comment:9 by , 14 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:10 by , 14 years ago
Triage Stage: | Ready for checkin → Accepted |
---|
comment:11 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
The "Changed in version 1.0" marker is going to be removed in 1.3 (ticket #14000). Otherwise, what would you have the documentation say? If you look at the code for a FloatField there's almost nothing happening. It's nearly as close to a vanilla Field subclass as you can get.
There are several other field classes that have very short descriptions in that document (BooleanField, for example). It's a conscious decision not to list all valid options for every field, and instead to only list the common options once at the top of the page.
If there is specific info you feel needs to be added, please re-open the ticket with more specifics (and ideally a patch). Thanks!