Hi, 

So easy :-)

Thanks i just didn't think of that hat.

Kind regards


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT Developer 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: +43 (1) 534 52 - 1573 
Fax: +43 (1) 534 52 - 146 


-----Ursprüngliche Nachricht-----

Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
Auftrag von Casey Greene
Gesendet: Mittwoch, 09. März 2011 14:12
An: django-users@googlegroups.com
Betreff: Re: automated query if already exists

Hi Patrick,

Does get not do what you want?

http://docs.djangoproject.com/en/dev/topics/db/queries/#retrieving-a-single-object-with-get

Hope this helps,
Casey

On 03/09/2011 08:03 AM, Szabo, Patrick (LNG-VIE) wrote:
> Hi,
>
> Since django is able to do so much so easy i was wandering if there was
> some kind of possibility to check if an entry with the same values
> already exists.
>
> I've tried unique_together but this only does the job on the database
> end and if i want to store an not unique object i get an error.
>
> I'd rather not show that error but return my own message.
>
> Is there a simpler way to do this thatn check alle the entries "manually"
>
> Kind regards
>
> . . . . . . . . . . . . . . . . . . . . . . . . . .
>
> **
>
> Patrick Szabo
> XSLT Developer
>
> LexisNexis
> Marxergasse 25, 1030 Wien
>
> patrick.sz...@lexisnexis.at <mailto:patrick.sz...@lexisnexis.at>
>
> Tel.: +43 (1) 534 52 - 1573
>
> Fax: +43 (1) 534 52 - 146
>
>
>
> --
> 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...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to