djangosnippets.org: Latest snippets tagged with 'orm-and-forms'https://djangosnippets.org/tags/orm-and-forms/2010-04-04T21:18:55.783761-05:00Dictionary of choices based in models
2010-04-04T21:18:55.783761-05:00marcoslhchttps://djangosnippets.org/snippets/1977/<p>Sometimes we need to build a ChoiceField from data in a Model or more than just one model via fk's but the ModelChoiceField is not <em>that</em> flexible. So, in order to obtain a list of tuples with pk and a descriptive text for the choices parameter of the ChoiceField use …</p>
Freely redistributable