Re: ModelAdmin.get_readonly_fields with ForeignKey's

2010-02-06 Thread Rishabh Manocha
On Sat, Feb 6, 2010 at 10:35 PM, Karen Tracey wrote: > On Sat, Feb 6, 2010 at 6:16 AM, Rishabh Manocha wrote: > >> [snip] >> While this works just fine, the one problem I'm having is that instead of >> showing the title of the book (i.e. - calling

Re: ModelAdmin.get_readonly_fields with ForeignKey's

2010-02-06 Thread Karen Tracey
On Sat, Feb 6, 2010 at 6:16 AM, Rishabh Manocha wrote: > [snip] > While this works just fine, the one problem I'm having is that instead of > showing the title of the book (i.e. - calling Book.__unicode__), the admin > simply shows the primary key value of the Book. > >

ModelAdmin.get_readonly_fields with ForeignKey's

2010-02-06 Thread Rishabh Manocha
Hi Guys, I was trying to use the newly introduced ModelAdmin.get_readonly_fields method to mark a OneToOne relation as read only - something along the lines of: models.py: class Book(models.Model): title = models.CharField(max_length = 50) ... def __unicode__(self): return