Hi Wim, my mistake I have a case of difference and the selection is a filter. So it should be no surprise that values which are not in this selection are NULL using the choice type.
Thanks for scrutinize my intention Christian Am Montag, 3. Juni 2013 12:51:38 UTC+2 schrieb Wim Feijen: > > Hi Christian, > > I recommend defining your own ModelForm and using that in the admin. For > an example using a custom form, see: > > https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.form > > But why don't you want a choicefield in the admin then? > > Regards, Wim > > On Monday, 3 June 2013 10:13:07 UTC+2, Christian Schulz wrote: >> >> Hi , >> >> I'm a newbie in django and wondering what is the most easy way to change >> the "behavoir" if I add a record for a model. >> >> class AttributeMapping(models.Model): >> #In the standard admin view I like a CharField to see filled entries >> field = models.CharField(max_length=100) >> #In the add case I like a choice a field >> #field = models.CharField(max_length=100,choices=fields) >> >> Many thanks, >> Christian >> > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.