commit=False in Model save?

2010-06-15 Thread Heleen
ere is such a function to achieve what I need or if there is a better way of doing this? Thanks very much! Heleen -- 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 unsubsc

Re: commit=False in Model save?

2010-06-15 Thread Heleen
when validation fails, etc. transaction.rollback() finally: transaction.commit() That should allow you to create the PKs and then get out of there if there's a problem. On Jun 15, 9:23 am, Heleen wrote: > Hello, > > I have a situation where I would like to do some validat

Re: commit=False in Model save?

2010-06-15 Thread Heleen
Thanks to the 'unknown' user for the reply. This is probably what I'm looking for. I think I have had a glance at it while searching the Django Docs but I don't think I fully understood it. I do now and will give it a go tomorrow morning! -- You received this message because you are subscribed to

Re: commit=False in Model save?

2010-06-16 Thread Heleen
Today I'm a bit more awake than when I replied yesterday and I realized that you're talking about views here. What I mean however is that I would like to do validation in the model class' save function in models.py. I have tried to use this method on my save function though, but it just gives me t

Admin Model Validation on ManyToMany Field

2010-07-13 Thread Heleen
ata and that someone could possibly give me a sollution to my problem. Thanks! Heleen -- 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

Re: Admin Model Validation on ManyToMany Field

2010-07-14 Thread Heleen
. > > hth, > nuno > > On Tue, Jul 13, 2010 at 1:45 PM, Heleen wrote: > > Hello, > > > I have the following classes: > > class Application(models.Model): > >  users = models.ManyToManyField(User, through='Permission') > >  folder = models.

Re: Admin Model Validation on ManyToMany Field

2010-07-15 Thread Heleen
r(lambda x:x in user.profile.company.all(),folder.company.all())) > 0: # this is an intersection raise forms.ValidationError("One of the users of this Application works for one of the Repository's organisations!") return cleaned_data And this works! On Jul 14, 5:16 pm

Validation on a Many-to-Many Through model ( unique_together=[a, b, c=1] )

2010-09-27 Thread Heleen
I have the following models (simplified example): class Book(models.Model): users = models.ManyToManyField(User, through=Permission) class Permission(models.Model): user = models.ForeignKey(User) role = models.ForeignKey(Group) active = models.BooleanField() book = models.ForeignKey(Book) W

send_mail not sending e-mail in view, but does send e-mail in shell

2010-02-15 Thread Heleen
wing startup script: #!/bin/sh PROJNAME=website PROJDIR=/var/www/heleen/website PORT=9001 cd ${PROJDIR}/../ /usr/bin/spawn --factory=spawning.django_factory.config_factory $ {PROJNAME}.settings --port=$PORT --threads=0 --processes=1 --access- log-file=/var/log/django/${PROJNAME} & Is ther

Re: send_mail not sending e-mail in view, but does send e-mail in shell

2010-02-17 Thread Heleen
s why it took us so long to figure this out. Thanks again for your help though. On Feb 16, 7:19 pm, creecode wrote: > Hello Heleen, > > I don't have any specific solutions for you.  In several of my > projects I have views that do deliver email without issue. > > A couple o