> > the 'default' keyword argument should work, but be sure to use the
> > stored-value(first) element from the stored/representation tuple you use.
>
> > ie if your UNITS tuple is defined
>
> > >>> UNITS = ( ('in', 'Inches'), ('cm', 'Centimeters'), )
>
> > you'll want to use
>
> > >>> class MyModel(models.Model):
> > >>>   units = models.CharField(maxlength=2, choices=UNITS, default='cm')


Hi,
I have similar problem. In my model I have field

owner = models.ForeignKey(User, maxlength=60,  db_index = True)

In application it appears as a combobox with a dashed line as an
initial value.
I'd like to initialize the field with the current username.
I have current user from ThreadLocalsMiddleware.get_current_user()

I tried to use default keyword but in my case it also was unavailable.
I also tried the method You suggested but there is no difference - the
initial value is still dashed line.
Is there any way to make out with it?

Thanks for any help,
Ana


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to