Difficulty with validation of multiple modelforms on 1 page

2012-05-07 Thread Roald
form? Or how you would refactor that? Thanks in advance! Kind regards, Roald -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Y-SyKhGnnLI

Re: Request Context problem

2012-02-20 Thread Roald
On 20 feb, 00:03, Reinout van Rees <rein...@vanrees.org> wrote: > On 19-02-12 14:16, dummyman dummyman wrote: > > The solution is simple: just add a {{ csrf_token }} somewhere in your > form. That ought to do it. A typo there, Reinout ;-). You meant: {% csrf_token %} Chee

Re: nested forms from model with manytomany

2011-09-15 Thread Roald de Vries
? Hi Visgean, I think you want inline formsets: https://docs.djangoproject.com/en/dev/topics/forms/modelforms/ #inline-formsets Cheers, Roald -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-user

Re: Is a model method the answer?

2011-05-26 Thread Roald
_set.update(bool_field=True) Cheers, Roald -- 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+unsubscr...@goog

reverse works with runserver, but not with wsgi

2011-05-26 Thread Roald
rguments '()' and keyword arguments '{}' not found. Cheers, Roald -- 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

Re: Setting a default value for a select widget in a modelformset

2010-09-05 Thread Roald de Vries
-data-with-a-formset Cheers, Roald -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com

Re: passing file from command line startup

2010-08-11 Thread Roald de Vries
; import sys >>> file = sys.stdin Option 2: read command line arguments >>> import sys >>> file = open(sys.argv[1]) Cheers, Roald -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: Adding request context to standard login/logout views?

2010-08-11 Thread Roald de Vries
tings/ #std:setting-TEMPLATE_CONTEXT_PROCESSORS? Cheers, Roald -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send e

Re: overwrite the save method

2010-08-11 Thread Roald de Vries
On Aug 11, 2010, at 7:25 PM, refreegrata wrote: My code -- class Format(models.Model): name = models.CharField(max_length=5, unique=True) myBoolean = models.BooleanField(default=False) class FormFormat(forms.ModelForm): boolean1 =

Re: add attributes to a field without widgets

2010-08-11 Thread Roald de Vries
creation: def __init__(self, *args, **kwargs): super(MyForm, self).__init__(*args, **kwargs) # If you want an other widget: # self.fields['name'].widget = forms.TextInput(attrs={something...}) self.fields['name'].widget.attrs['something'] = ... Cheers, Roald -- Yo

Re: Search Field on All Pages

2010-08-08 Thread Roald de Vries
the django DRY principles. Personally, I like all of my forms to be classes. If you want that, you should create a context processor. http://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-context-processors Cheers, Roald -- You received this message because you are subscribed

database object initialization versus python object initalization

2010-08-06 Thread Roald de Vries
, and therefore be saved in the database. If I create a personupdate using PersonUpdate.objects.create or ~.get_or_create, I don't mind saving the object, but I don't want to call 'self.save()' in PersonUpdate.__init__. How should I handle this? Cheers, Roald -- You received this message because you

Re: model inheritance, abtract=True

2010-08-05 Thread Roald de Vries
On Aug 5, 2010, at 3:15 PM, Roald de Vries wrote: On Aug 5, 2010, at 3:00 PM, Emily Rodgers wrote: On Aug 5, 1:50 pm, Roald de Vries <downa...@gmail.com> wrote: Dear all, I have the following error, and don't know what it means: Error: One or more models did not va

Re: model inheritance, abtract=True

2010-08-05 Thread Roald de Vries
On Aug 5, 2010, at 3:00 PM, Emily Rodgers wrote: On Aug 5, 1:50 pm, Roald de Vries <downa...@gmail.com> wrote: Dear all, I have the following error, and don't know what it means: Error: One or more models did not validate: update.personupdate: 'address' has a relation with

model inheritance, abtract=True

2010-08-05 Thread Roald de Vries
the problems started when I separated my Person class into an abstract base class PersonProfile and a derived class Person, and added the class PersonUpdate, deriving from PersonProfile too. Can anybody help? Thanks in advance, cheers, Roald -- You received this message because you are subscribed

Re: Best way to present N items in table row for list

2010-07-29 Thread Roald de Vries
n [lst[start:start+5] for start in range(0, len(lst), 5)] Cheers, Roald -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to djang

Re: Django INNER JOIN

2010-07-28 Thread Roald de Vries
e querying the Projects, you can not use Favourite fields as keywords. So you'll (more or less) have to stick with the other option. Cheers, Roald -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: Django INNER JOIN

2010-07-28 Thread Roald de Vries
On Jul 28, 2010, at 5:19 PM, kostia wrote: Thank you very much Roald, What is faster: projects = Project.objects.filter(favourites__user = request.user) or select_related('project') ? I think it doesn't matter much, but if one is faster, it should be the first one. If you only use

Re: Django INNER JOIN

2010-07-28 Thread Roald de Vries
oject')" if performance is an issue for you. Cheers, Roald -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to d

Re: Django IDE

2010-07-18 Thread Roald de Vries
s, VIM doesn't leave you with a crippled little finger (from all the 's) - VIM has more commands than Emacs I would say Emacs makes you more productive on shorter term, VIM makes you more productive on longer term. Cheers, Roald -- You received this message because you are subscribed to the

Re: code repetition in views

2010-04-18 Thread Roald de Vries
snippet to django-dev and django-snippets in a few weeks. Kind regards, Roald -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email

Re: How can i populate app engine(production environment) database with local sdk database

2010-04-05 Thread Roald de Vries
On Mar 31, 2010, at 9:12 AM, Eximius wrote: Please help me out On Mar 29, 11:04 pm, Eximius wrote: Hi all, I have created a django application using app engine sdk, and have stored data in database using forms. But the problem i am getting when i deploy it, the

Re: Strange difference between runserver and shell

2010-03-12 Thread Roald de Vries
On Mar 11, 2010, at 11:56 AM, pyt...@roalddevries.nl wrote: I have the following model: 1 class MyOrderItem(models.Model): 2 orderitem = models.ForeignKey(OrderItem, null=True, blank=True) 3 # other fields 4 5 def save(self, *args, **kwargs): 6