Re: automatically generated field in admin

2008-10-01 Thread Ramashish Baranwal
> > > I have a model in which a field should be generated automatically. So > > it shouldn't be shown in the admin add page. Also in the change page > > it should be shown but should be non-editable. As an example- > > Pending ticket 342, another way to do this is to make a custom admin > change_f

Re: automatically generated field in admin

2008-10-01 Thread Carl Meyer
On Oct 1, 8:34 am, Ramashish Baranwal <[EMAIL PROTECTED]> wrote: > I have a model in which a field should be generated automatically. So > it shouldn't be shown in the admin add page. Also in the change page > it should be shown but should be non-editable. As an example- Pending ticket 342, anoth

Re: automatically generated field in admin

2008-10-01 Thread krylatij
Full example here http://code.djangoproject.com/wiki/NewformsHOWTO#Q:HowdoIchangetheattributesforawidgetonafieldinmymodel. class MyModelAdmin(admin.ModelAdmin): ... def formfield_for_dbfield(self, db_field, **kwargs): field = super(MyModelAdmin, self).formfield_for_dbfield(db_fiel

Re: automatically generated field in admin

2008-10-01 Thread Karen Tracey
On Wed, Oct 1, 2008 at 8:34 AM, Ramashish Baranwal < [EMAIL PROTECTED]> wrote: > > Hi, > > I have a model in which a field should be generated automatically. So > it shouldn't be shown in the admin add page. Also in the change page > it should be shown but should be non-editable. As an example- >

automatically generated field in admin

2008-10-01 Thread Ramashish Baranwal
Hi, I have a model in which a field should be generated automatically. So it shouldn't be shown in the admin add page. Also in the change page it should be shown but should be non-editable. As an example- class Student(models.Model): first = models.CharField(max_length=64) last = models.