Wiadomość napisana przez Stephen Burrows w dniu 5 kwi 2012, o godz. 07:41:
> I generally like this idea, except for the implicit integer ids based
> on declaration order.
Thanks for your input. I will add the ability to explicitly set .id values for
each Choice in the next release.
> As people have said, it seems like just asking
> for data corruption.
Fair enough, although that does not match my experience.
> I'd much rather see implicit character ids based
> on the attribute name of the choice, analogous to django fields.
>>> class Gender(Choices):
... m = Choice("male")
... f = Choice("female")
... n = Choice("not specified")
...
>>> Gender(item=lambda c: (c.name, c.desc))
[(u'm', u'male'), (u'f', u'female'), (u'n', u'not specified')]
> Will you be making this project available as a third-party app?
pip install dj.choices
--
Best regards,
Łukasz Langa
Senior Systems Architecture Engineer
IT Infrastructure Department
Grupa Allegro Sp. z o.o.
http://lukasz.langa.pl/
+48 791 080 144
--
You received this message because you are subscribed to the Google Groups
"Django developers" 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-developers?hl=en.