Re: default value for foreign key and CharField

2009-02-09 Thread knight
Thanks, My Media_biz is edited inline in another class. So I have: class MetadataInline(admin.StackedInline) and class MetadataAdmin(admin.ModelAdmin) Can you tell what method I should override and in which class in order to set the initial value while editing inline? Regards, Alex Arshavski.

Re: default value for foreign key and CharField

2009-02-05 Thread Rajesh Dhawan
> > > > I have the following classes in my models.py: > > > > class Default(models.Model): > > > name = models.CharField(max_length=50, choices = > > > (('rental_period', 'rental_period'), ('currency', 'currency')), > > > unique=True) > > > value = models.CharField(max_length=50) > > > >

Re: default value for foreign key and CharField

2009-02-05 Thread Daniel Roseman
On Feb 5, 3:59 pm, knight wrote: > Hi, > > I have the following classes in my models.py: > > class Default(models.Model): >     name = models.CharField(max_length=50, choices = > (('rental_period', 'rental_period'), ('currency', 'currency')), > unique=True) >     value =

Re: default value for foreign key and CharField

2009-02-05 Thread knight
Hi, Thanks for the fast reply. Each Default instance provide default value for one of the fields: I want to take the default value of rental_period to rental_period and default value of currency to currency. The value of the currency should be the name of Currency object for foreign key. Thanks,

Re: default value for foreign key and CharField

2009-02-05 Thread Rajesh Dhawan
On Feb 5, 10:59 am, knight wrote: > Hi, > > I have the following classes in my models.py: > > class Default(models.Model): > name = models.CharField(max_length=50, choices = > (('rental_period', 'rental_period'), ('currency', 'currency')), > unique=True) > value =

default value for foreign key and CharField

2009-02-05 Thread knight
Hi, I have the following classes in my models.py: class Default(models.Model): name = models.CharField(max_length=50, choices = (('rental_period', 'rental_period'), ('currency', 'currency')), unique=True) value = models.CharField(max_length=50) class Media_biz(models.Model): name =