django sets Meta.fields to None

2009-02-03 Thread JonUK
I have the following class: class QuoteForm( ModelForm ): class Meta: fields = [ 'user', 'photo', 'created', 'usage', 'complete', ] model = Quote def __init__(self, *args, **kwargs ): import pdb; pdb.set_trace() super( QuoteForm, self ).__init__( *args, *

Re: Admin screen counts correctly but returns no records

2009-01-29 Thread JonUK
Thanks Daniel, I'll take your advice. I'm surprised (i.e. don't understand why) this approach is problematic though. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Admin screen counts correctly but returns no records

2009-01-29 Thread JonUK
I'm creating a new admin UI for User, separate to the standard admin User interface - I have the following setup: class WebsiteUser( User ): class Meta: db_table = 'auth_user' class WebsiteUserAdmin( admin.ModelAdmin ): list_display = ( 'username', ) admin.site.register( Website

Re: Form validated before submitted

2009-01-27 Thread JonUK
Solved - problem was caused by these lines def __init__(self, *args, **kwargs ): super( ContactForm, self ).__init__( args, kwargs ) changing to explicit parameter names fixed it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Form validated before submitted

2009-01-27 Thread JonUK
I have a ModelForm and a view, but the form's validation messages are always rendered on first viewing - any idea why? # ModelForm class ContactForm( ModelForm ): first_name = CharField( 'Firstname' ) last_name = CharField( 'Lastname' ) company = CharField( 'Company' ) tel = CharF

Re: in what namespace do widgets reside?

2009-01-27 Thread JonUK
great - thanks! --~--~-~--~~~---~--~~ 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+unsu

in what namespace do widgets reside?

2009-01-27 Thread JonUK
Apologies for the daft question, but after 10 mins of trawling through the official docs and various random google articles, I cannot find thyis info. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django us

Re: How to obtain an intermediate ManyToMany object?

2009-01-16 Thread JonUK
Thank You! That was the correct syntax :) For anyone else with the same problem, you can also utilise "related_name" to provide syntactically pleasing access to your objects (have changed class name LightboxPhotograph to Item), such as: lightbox.photographs.all() - to retrieve Photograph objects

Re: How to obtain an intermediate ManyToMany object?

2009-01-16 Thread JonUK
Thank You! That was the correct syntax :) For anyone else with the same problem, you can also utilise "related_name" to provide syntactically pleasing access to your objects, such as: lightbox.photographs.all() - to retrieve Photograph objects lightbox.items.all() - to retrieve Item objects phot

Re: How to obtain an intermediate ManyToMany object?

2009-01-15 Thread JonUK
lightbox.lightboxphotograph_set yields: TypeError: "'RelatedManager' object is not iterable" :( --~--~-~--~~~---~--~~ 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

Re: How to obtain an intermediate ManyToMany object?

2009-01-15 Thread JonUK
Thanks, but that gives me: AttributeError: "'Lightbox' object has no attribute 'lightboxes'" --~--~-~--~~~---~--~~ 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@go

How to obtain an intermediate ManyToMany object?

2009-01-15 Thread JonUK
I have this model (bits omitted for brevity): class Photograph(ImageModel): title = models.CharField(_('title'), max_length=100, unique=True ) class Lightbox(models.Model): photographs = models.ManyToManyField('Photograph', related_name='lightboxes

django discarding MySQL results for "in" operator

2009-01-05 Thread JonUK
Apologies as this is a repost, but I'm completely stuck! I'm using django 1.0.2 and the tagging app to retrieve a tag via a database "in" query, and something is causing the query results to be discarded. In particular, this line of code from tagging.utils.get_tag_list() executes: return Tag.ob

django ignoring MySQL case insensitivity for "in" operator

2009-01-04 Thread JonUK
I'm using django 1.0.2 and the tagging app to retrieve a tag via a database "in" query, and something is causing the "in" operator's native nehaviour to be ignored. In particular, this line of code from tagging.utils.get_tag_list() executes: return Tag.objects.filter(name__in=[fo