Sorry I didn't reread this thread, or remembered it after my previous post.
I just replied to clearify my previous post.
Tino
On Mon, Oct 4, 2010 at 02:57, LookMa NoSQL wrote:
> Tino, are you joking? Did you even bother to read the OP's proposal. I
> think there is a
Tino, are you joking? Did you even bother to read the OP's proposal. I
think there is a real lack of patience when you spend the time writing
what the OP has written without even reading it, just to try to
dismiss it.
OP:
>def clean(self):
>if any((self.weight, self.height))
>if not
Doesn't this do what you want?:
class MyModel(models.Model):
weight = ..
height = ...
width = ...
length = ...
def clean(self):
from django.core.exceptions import ValidationError
if self.weight or self.height or self.width or self.length and
+1 on proposal (for what it matters).
Tina, where did you see that Django does that? The docs link you sent
shows regular model validation. What Mamayo is looking for, I think,
is the ability to add a Meta option to a model that says
required_together=({fields: ('weight', 'height', 'width',
Hi,
Isn't this covered by model validation [1]?
Tino
[1]
http://docs.djangoproject.com/en/dev/ref/models/instances/#validating-objects
On Fri, Oct 1, 2010 at 15:59, hejsan wrote:
> Hi.
> I just filed a feature request on the same or similar issue, and this
> thread was
Hi.
I just filed a feature request on the same or similar issue, and this
thread was brought to my attention:
http://code.djangoproject.com/ticket/14347
Basically the usecase is this:
Very often we have a "Published" field on our models (or "Published
date" or "Published status" etc..) It would
Thanks, David. I've read some about the "Custom validation error on
unique_together" ticket. I imagine that if people want customization
there, required_together would need the same. The only idea I have
that seems to work for both situations is:
required_together = (('weight', 'height', 'You
On Sep 27, 9:22 am, "David P. Novakovic"
wrote:
> Is it? I read this as different to anything in the ORM.
Well either way; he could have been more specific which stuff he is
talking about (remember the only classes having Meta are Modelform and
Model -- at least does
Is it? I read this as different to anything in the ORM.
This is about conditionally requiring a second field if one is filled
out. Normally it would be done at the JS level.
I think it's a good idea, assuming I haven't missed something that
already does this.
I can't help thinking this is part
This is a feature request. I'm not asking how to do it. If you read,
I've shown the current method of doing this in clean(). I'm proposing
the addition of an additional Meta option to allow for automatically
adding this behavior.
On Sep 27, 1:18 am, Florian Apolloner
Please post usage questions to the users list. This is already doable
with model validation.
Florian
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe
11 matches
Mail list logo