Re: '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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: '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 <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: '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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: classes
Ahhh! Thanks, didn't know (obviously) about that one! -joe On 6/21/07, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote: > > Actually, type is a function, not a method. > type(x) == x.__class__ > > Regards, > Aidas Bendoraitis aka Archatas > > > On 6/18/07, Joseph Heck <[EMAIL PROTECTED]> wrote: > > > > x = '123' > > x.__class__ will give a reasonable answer, x.type() doesn't. (Python 2.4) > > > > If you can get away with using type(), it's probably a lot cleaner to use... > > > > -joe > > > > On 6/18/07, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote: > > > > > > or type() > > > > > > On 6/7/07, Joseph Heck <[EMAIL PROTECTED]> wrote: > > > > > > > > .__class__ > > > > > > > > On 6/7/07, Lic. José M. Rodriguez Bacallao <[EMAIL PROTECTED]> wrote: > > > > > how can I know insede a method the type of my class dynamicaly? > > > > > > > > > > -- > > > > > Lic. José M. Rodriguez Bacallao > > > > > Cupet > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: classes
Actually, type is a function, not a method. type(x) == x.__class__ Regards, Aidas Bendoraitis aka Archatas On 6/18/07, Joseph Heck <[EMAIL PROTECTED]> wrote: > > x = '123' > x.__class__ will give a reasonable answer, x.type() doesn't. (Python 2.4) > > If you can get away with using type(), it's probably a lot cleaner to use... > > -joe > > On 6/18/07, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote: > > > > or type() > > > > On 6/7/07, Joseph Heck <[EMAIL PROTECTED]> wrote: > > > > > > .__class__ > > > > > > On 6/7/07, Lic. José M. Rodriguez Bacallao <[EMAIL PROTECTED]> wrote: > > > > how can I know insede a method the type of my class dynamicaly? > > > > > > > > -- > > > > Lic. José M. Rodriguez Bacallao > > > > Cupet > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: classes
x = '123' x.__class__ will give a reasonable answer, x.type() doesn't. (Python 2.4) If you can get away with using type(), it's probably a lot cleaner to use... -joe On 6/18/07, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote: > > or type() > > On 6/7/07, Joseph Heck <[EMAIL PROTECTED]> wrote: > > > > .__class__ > > > > On 6/7/07, Lic. José M. Rodriguez Bacallao <[EMAIL PROTECTED]> wrote: > > > how can I know insede a method the type of my class dynamicaly? > > > > > > -- > > > Lic. José M. Rodriguez Bacallao > > > Cupet > > > > > > > > > > > > > > > > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: classes
or type() On 6/7/07, Joseph Heck <[EMAIL PROTECTED]> wrote: > > .__class__ > > On 6/7/07, Lic. José M. Rodriguez Bacallao <[EMAIL PROTECTED]> wrote: > > how can I know insede a method the type of my class dynamicaly? > > > > -- > > Lic. José M. Rodriguez Bacallao > > Cupet > > > > > > > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: classes
.__class__ On 6/7/07, Lic. José M. Rodriguez Bacallao <[EMAIL PROTECTED]> wrote: > how can I know insede a method the type of my class dynamicaly? > > -- > Lic. José M. Rodriguez Bacallao > Cupet > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---