Guillermo,
Please see the 'unique_together' syntax:
http://docs.djangoproject.com/en/dev/ref/models/options/#unique-together
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this g
Thanks, Mihail! Sometimes I don't know where to look for what I need,
but the docs are indeed stellar!
On Oct 18, 8:24 pm, Михаил Лукин wrote:
> http://docs.djangoproject.com/en/dev/ref/models/options/#unique-together
> why don't you like to read docs first. Django docs are amazing!
>
> 2009/10/
http://docs.djangoproject.com/en/dev/ref/models/options/#unique-together
why don't you like to read docs first. Django docs are amazing!
2009/10/18 Guillermo
>
> Ok I've done the following:
>
> def save(self):
>r = TargetMessage.objects.filter(src_fk=self.src_fk,
>
Ok I've done the following:
def save(self):
r = TargetMessage.objects.filter(src_fk=self.src_fk,
lang_fk=self.lang_fk)
if not r:
super(TargetMessage, self).save()
How can I propagate a validation error to the admin interface
Hi all,
I want my records to be unique for field A and B together, so that no
two records can share the same values for those particular fields. How
can this be declared in the model?
Regards,
Guillermo
--~--~-~--~~~---~--~~
You received this message because you a
On Sun, 2009-01-18 at 09:58 -0700, Dj Gilcrease wrote:
> On Sun, Jan 18, 2009 at 4:34 AM, Malcolm Tredinnick
> wrote:
> >> Right now, that is only enforced by the admin interface,
> >
> > I should have extended this to also say "and ModelForms", since if you
> > create a ModelForm from a Model, u
On Sun, Jan 18, 2009 at 4:34 AM, Malcolm Tredinnick
wrote:
>> Right now, that is only enforced by the admin interface,
>
> I should have extended this to also say "and ModelForms", since if you
> create a ModelForm from a Model, unique and unique_together are
> respected.
It's respected for any
On Sun, 2009-01-18 at 22:32 +1100, Malcolm Tredinnick wrote:
[...]
> Have a look at unique_together:
> http://docs.djangoproject.com/en/dev/ref/models/options/#unique-together
>
> Right now, that is only enforced by the admin interface,
I should have extended this to also say "and ModelForms", s
On Sun, 2009-01-18 at 02:40 -0800, Konstantin wrote:
> Hello!
>
> First of all I want to apologize for maybe very basic question, but I
> newbie in django and web coming from c/c++ world.
>
> I have two models:
>
> class Box(models.Model):
> description = models.CharField(max_length=250)
>
Maybe this would help?
http://docs.djangoproject.com/en/dev/ref/models/options/#unique-together
On Jan 18, 10:40 am, Konstantin wrote:
> Hello!
>
> First of all I want to apologize for maybe very basic question, but I
> newbie in django and web coming from c/c++ world.
>
> I have two models:
>
Hello!
First of all I want to apologize for maybe very basic question, but I
newbie in django and web coming from c/c++ world.
I have two models:
class Box(models.Model):
description = models.CharField(max_length=250)
id = models.IntegerField(primary_key=True)
def __unicode__(self)
11 matches
Mail list logo