Re: searching a model in admin with data from a related model

2011-02-26 Thread natebeacham
Yes, as far as I know if CustomerId was changed to: customer = models.ForeignKey(Customer) You would be able to say: search_fields = ['barcode', 'customer__first_name', 'customer__last_name'] ...on your Tracker's ModelAdmin. Cheers On Feb 25, 5:54 pm, Bobby Roberts wrote: > consider this mod

Re: 404 view -> redirect to index

2011-01-18 Thread natebeacham
Thomas: That is what he has. Make sure you turn DEBUG off. Your custom 404 handler will only be used when you are not in debug mode. Cheers On Jan 18, 5:10 am, Thomas wrote: > The book "The definitive Guide to Django" says on page 476: > > ---8<--- > > ... if you want to override the 404 view,

Re: ReportLab and Django - templates? ; FK object has no attribute split

2010-11-17 Thread natebeacham
Try using: text = item.category.name and text = '%s' % item.subject.name Rather than sending the entire FK field to ReportLab. I don't necessarily see a problem with this logic in your view, as you're just generating a file response. If it doesn't feel right, you can throw this logic into a ut

Re: Problem with custom tags

2010-11-11 Thread natebeacham
I assume webinterface is your django app. If so, you'll need to add it to INSTALLED_APPS. On Nov 11, 2:18 pm, vivek_12315 wrote: > My project is in folder: webinterface/ > > I have defined a custom "webinterface_tags.py" inside my project: > > webinterface/templatetags/webinterface_tags.py > > My

Re: Strange error overriding changelist_view in ModelAdmin

2010-08-03 Thread natebeacham
Try not passing "self" to your super call. That parameter should be handled internally. ie: return super(SettingsAdmin, self).change_view(request, object_id, extra_context=None) On Aug 3, 8:26 pm, Erisa wrote: > I have a Settings model that contains settings for my application. > > class Setting

Re: Jquery nav disabled in Django base template??? help please

2010-07-15 Thread natebeacham
Or, if you don't want to over complicate things... $(function() { $('#nav li a').each(function() { if ($(this).attr('href') == window.location.pathname) { $(this).addClass('active'); } }); }); On Jul 15, 12:15 pm, David De La Harpe Golden wrote: > On 15/07/10

Re: sorl-thumbnail: random name in Thumbnail field

2010-04-30 Thread natebeacham
Assuming ThumbnailField extends ImageField, try: class foo(models.Model): pic = ThumbnailField(upload_to = lambda instance: 'pics/%s.jpg' % str(uuid.uuid4()), size=(200, 200)) On Apr 29, 12:57 pm, xRobot wrote: > thanks but now I prefer to tweak sorl-thumbnail ;) > > --- > > On 2

Re: Dajaxice with Jquery issue

2010-04-14 Thread natebeacham
Use back slashes to escape your nested quotes. ie: onClick='Dajaxice.maps.reservation(\'reservation_callBack\')' On Apr 14, 11:02 am, Alexis Selves wrote: > Hi everyone, > I am trying to use dajax with jquery. I am dynamicaly making forms > with Jquery and  each contains button with dajax refere