Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » 'classes': 'collapse' not providing 'click to expand' link [RSS Feed]

#1 March 26, 2008 14:38:01

J.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

'classes': 'collapse' not providing 'click to expand' link


As far as I can tell, the javascript is importing properly, and the
URL that it's including from in the HTML output works when I put it
straight into my browser. Here's the full definition of a model
including the fieldset definitions. When I view it in the admin
interface the 'Details' field is collapsed but without a link to
expand it.

class Location(models.Model):
name = models.CharField(max_length=20)
address1 = models.CharField(max_length=50)
address2 = models.CharField(max_length=50, blank=True)
city = models.CharField(max_length=20)
state = models.USStateField()
zipcode = models.CharField(max_length=10)
country = models.CharField(max_length=20)
latitude = models.DecimalField(max_digits=8, decimal_places=6,
blank=True, null=True)
longitude = models.DecimalField(max_digits=8, decimal_places=6,
blank=True, null=True)
public_transport_directions = models.TextField(blank=True)
phone_number = models.PhoneNumberField(blank=True)
url = models.URLField(blank=True)

def __unicode__(self):
return self.name

class Admin:
# pass
fields = (
(None, {
'fields': ('name', 'address1', 'address2',
'city', 'state',
'zipcode', 'country')
}),
('Details', {
'classes': 'collapse',
'fields': ('latitude', 'longitude',
'public_transport_directions',
'phone_number', 'url')
}),
)
--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#2 March 26, 2008 16:56:10

J.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

'classes': 'collapse' not providing 'click to expand' link


Got some more info.

Apparently I'm getting a 'gettext is not defined' error in my
JavaScript. This is not only affecting collapsing, but all JavaScript
in the admin interface. So things like date widgets are not working
either.

Hopefully this should make it much easier to track down and fix the
problem...

On Mar 26, 9:37 am, Josh <> wrote:
> As far as I can tell, the javascript is importing properly, and the
> URL that it's including from in the HTML output works when I put it
> straight into my browser. Here's the full definition of a model
> including the fieldset definitions. When I view it in the admin
> interface the 'Details' field is collapsed but without a link to
> expand it.
>
> class Location(models.Model):
>         name = models.CharField(max_length=20)
>         address1 = models.CharField(max_length=50)
>         address2 = models.CharField(max_length=50, blank=True)
>         city = models.CharField(max_length=20)
>         state = models.USStateField()
>         zipcode = models.CharField(max_length=10)
>         country = models.CharField(max_length=20)
>         latitude = models.DecimalField(max_digits=8, decimal_places=6,
> blank=True, null=True)
>         longitude = models.DecimalField(max_digits=8, decimal_places=6,
> blank=True, null=True)
>         public_transport_directions = models.TextField(blank=True)
>         phone_number = models.PhoneNumberField(blank=True)
>         url = models.URLField(blank=True)
>
>         def __unicode__(self):
>                 return self.name
>
>         class Admin:
>                 # pass
>                 fields = (
>                         (None, {
>                                 'fields': ('name', 'address1', 'address2',
> 'city', 'state',
> 'zipcode', 'country')
>                         }),
>                         ('Details', {
>                                 'classes': 'collapse',
>                                 'fields': ('latitude', 'longitude',
> 'public_transport_directions',
> 'phone_number', 'url')
>                         }),
>                 )
--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

#3 March 26, 2008 17:16:00

J.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

'classes': 'collapse' not providing 'click to expand' link


Ok. I determined that the problem was with my jsi18n URL. Going to /
admin/jsi18n/ got me a 404. I figured the problem was related to some
custom admin URLs I had written. So I commented out all my custom
admin URLs and everything started working again.

Here's where it gets weird. I uncommented those admin URLs one at a
time to figure out which was causing the problem, and it never
reappeared. With the urls.py file back exactly the way it had been
when the problem was present, the problem is now gone.

Weird.

On Mar 26, 11:56 am, Josh <> wrote:
> Got some more info.
>
> Apparently I'm getting a 'gettext is not defined' error in my
> JavaScript. This is not only affecting collapsing, but all JavaScript
> in the admin interface. So things like date widgets are not working
> either.
>
> Hopefully this should make it much easier to track down and fix the
> problem...
>
> On Mar 26, 9:37 am, Josh <> wrote:
>
> > As far as I can tell, the javascript is importing properly, and the
> > URL that it's including from in the HTML output works when I put it
> > straight into my browser. Here's the full definition of a model
> > including the fieldset definitions. When I view it in the admin
> > interface the 'Details' field is collapsed but without a link to
> > expand it.
>
> > class Location(models.Model):
> >         name = models.CharField(max_length=20)
> >         address1 = models.CharField(max_length=50)
> >         address2 = models.CharField(max_length=50, blank=True)
> >         city = models.CharField(max_length=20)
> >         state = models.USStateField()
> >         zipcode = models.CharField(max_length=10)
> >         country = models.CharField(max_length=20)
> >         latitude = models.DecimalField(max_digits=8, decimal_places=6,
> > blank=True, null=True)
> >         longitude = models.DecimalField(max_digits=8, decimal_places=6,
> > blank=True, null=True)
> >         public_transport_directions = models.TextField(blank=True)
> >         phone_number = models.PhoneNumberField(blank=True)
> >         url = models.URLField(blank=True)
>
> >         def __unicode__(self):
> >                 return self.name
>
> >         class Admin:
> >                 # pass
> >                 fields = (
> >                         (None, {
> >                                 'fields': ('name', 'address1', 'address2',
> > 'city', 'state',
> > 'zipcode', 'country')
> >                         }),
> >                         ('Details', {
> >                                 'classes': 'collapse',
> >                                 'fields': ('latitude', 'longitude',
> > 'public_transport_directions',
> > 'phone_number', 'url')
> >                         }),
> >                 )
>
>
--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en-~----------~----~----~----~------~----~------~--~---

Offline

  • Root
  • » Django
  • » 'classes': 'collapse' not providing 'click to expand' link [RSS Feed]

Board footer

Moderator control

Enjoy the 16th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support