On Wed, Jun 1, 2016 at 9:23 AM Sven R. Kunze email@example.com wrote:
On 01.06.2016 08:25, Sjoerd Job Postmus wrote:
On 31 May 2016, at 16:37, Sven R. Kunze firstname.lastname@example.org wrote:
Btw. there would be huge use-case for Django development. So, given
your explanation, it sounds useful.
Could you elaborate on that use-case, because I'm not seeing it. I think
maybe you mean the ORM and declarative forms, correct?
Exactly. That is one reason why Django needs metaclasses all over the place. Because fields just don't know their name.
This is especially true for forms as django does not magic there. It always causes headaches if you need it.
Are you referring to code like this ? your_name = forms.CharField(label='Your name')
If so, I don't think we actually want the LHS to get passed in as the label. Not all labels will be valid identifiers. If you're talking about the CharField knowing what attribute it has been assigned to, I couldn't find that code in the Django source. Could you point it out?