#23362: Database Columns as "Attributes"
-------------------------------+--------------------
Reporter: MalikRumi | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
I recently got an Attribute Error which told me that my type object
'Articles' has no attribute 'name'. Well, I thought that was crazy,
because 'name' was the very first field on my Articles model. I did some
digging in dir() on the shell, only to find out that indeed Articles did
not have an attribute 'name'. Digging further, I found that it did have an
'object' called name, but these objects are not Python attributes, or
perhaps, only become attributes at runtime. So where did I get the idea
that they were?
[https://docs.djangoproject.com/en/1.6/intro/tutorial01/]
{{{# Access database columns via Python attributes.
>>> p.question
"What's new?"
>>> p.pub_date
datetime.datetime(2012, 2, 26, 13, 0, 0, 775217, tzinfo=<UTC>)}}}
I think this language needs to be clarified. One could argue that the
proper interpretation is ‘access database columns as if’, or ‘in the same
style as’, rather ‘through their’(nonexistent) Python attributes.
--
Ticket URL: <https://code.djangoproject.com/ticket/23362>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.7c98659933316dce50566d0fc15f5646%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.