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, *
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
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
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
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
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
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
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
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
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
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
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
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
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
14 matches
Mail list logo