django use model choices in modelform
问题 I was wondering how i should use my model choices options, in my ModelForm. Example(model): class NPCGuild(models.Model): CATEGORIES=( ('COM', 'Combat'), ('CRA', 'Crafting'), ('WAR', 'Warfare'), ) faction = models.ForeignKey(Faction) category = models.CharField(max_length=3, choices=CATEGORIES) name = models.CharField(max_length=63) My Form: class NPCGuildForm(forms.ModelForm): name = forms.CharField() category = forms.CharField( some widget?) faction_set = Faction.objects.all() faction =