Monday, August 15, 2011

Admin inlines suddenly missing?

Hi folks --

I'm having a problem with admin inlines on a particular model suddenly
not showing up, even though they were working previously. Oddly,
they're working just fine on the exact same code in staging (granted,
on a somewhat different server setup) but not in production.

The only changes I've made between versions are to wrap any help text
for each model field in ugettext_lazy.

I've googled, and the only suggestion I've found is that the
__unicode__ methods of the models might be throwing errors -- I tested
them on the command line, on those specific objects, and everything
was fine.

Below are the (simplified) models and admins. Since I can't reproduce
the problem in staging, can anyone suggest where to start in terms of
tracking down what's going wrong without disrupting production?

Thanks!
Nan


### models.py
class Zone(models.Model):
name = models.CharField(max_length=100)
...

def __unicode__(self):
return self.name
...


class MyThing(models.Model):
ticket = models.ForeignKey('Ticket', related_name='played_zones')
zone = models.ForeignKey(Zone)
...

objects = MyThingManager()

def __unicode__(self):
return u'%s / %s' % (self.ticket, self.zone)
...

class Ticket(models.Model):
activation_code = models.CharField(max_length=64, unique=True,
help_text=_l('Max length 64 characters for a regular ticket; 30
characters for demo ticket.'))
...

objects = TicketManager()

def __unicode__(self):
return self.activation_code
...


### admin.py
class MyThingInline(admin.TabularInline):
model = MyThing
extra = 0

class TicketAdmin(admin.ModelAdmin):
inlines = [MyThingInline,]
save_as = True
...

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate