Ah! Fantastic! I love it when I make a dumb mistake because it's an easy
solution!
Instead of:
class DummyModel(models.Model):
dummyJson = JSONField(validators = [TestValidator])#Using class, wrong!
I should be doing:
class DummyModel(models.Model):
dummyJson = JSONField(validators = [T
On Sunday, 28 August 2016 07:54:47 UTC+1, Ryan Causey wrote:
>
> So I've dug into this a little more, and I've come up with the debugger
> trace below.
>
> -> dummyModelInstance.full_clean()
> c:\program files\python35\lib\site-packages\django\db\models\base.py(
> 1210)full_clean()
> -> self.cle
So I've dug into this a little more, and I've come up with the debugger
trace below.
-> dummyModelInstance.full_clean()
c:\program files\python35\lib\site-packages\django\db\models\base.py(1210)
full_clean()
-> self.clean_fields(exclude=exclude)
c:\program files\python35\lib\site-packages\dja
Thank you. That helped me solving the problem :)
على السبت 12 تـمـوز 2014 20:12, كتب tim:
Model validation is not invoked when calling model.save(). You can
read more
here: https://docs.djangoproject.com/en/1.6/ref/models/instances/#validating-objects
On Saturday, July 12, 2014 6:46:17 AM UTC-
Model validation is not invoked when calling model.save(). You can read
more
here:
https://docs.djangoproject.com/en/1.6/ref/models/instances/#validating-objects
On Saturday, July 12, 2014 6:46:17 AM UTC-4, thebsom wrote:
>
> Hello
> I am creating a django library application. I have made a bo
I've found the solution, initially I was looking in wrong direction.
All I needed to do is to use ``Model.clean()`` method and then call
``Model.full_clean()`` in ``save()``:
from django.contrib.auth.models import User
class CustomUser(User)
def clean(self):
""" Clean username field t
You can probably use a form to do most of what you want, with the caveat
that as long as your restrictions are more restrictive than any db
constraints that auth.User puts in there are.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view t
Thanks for the update!
On Oct 9, 1:50 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Tue, 2007-10-09 at 10:44 -0700, jacoberg2 wrote:
> > I have regular and custom validators in my models.
> > I also have a custom manipulator in my view, so i can get the field
> > data in a
> > form. Is i
On Tue, 2007-10-09 at 10:44 -0700, jacoberg2 wrote:
> I have regular and custom validators in my models.
> I also have a custom manipulator in my view, so i can get the field
> data in a
> form. Is it necessary to put the validators in the custom manipulator
> in order
> to dynamically present the
Marcin Jurczuk wrote:
> Hello,
> I'm writing my own validator based on shipped with django and wondering
> how get validated object.id field ?
Validators come in two varieties: those linked to field definitions in
models and those that linked to field definitions in custom manipulators.
With fi
Good morning,On 4/25/06, Michael Radziej <[EMAIL PROTECTED]> wrote:
I don't know what you mean with "stop". I think each validator will beexecuted, but they will take into account whether record_type has theright value.Anyway, I personally give up :-(
You can try to find out what's happening:- crea
On 4/25/06, Michael Radziej <[EMAIL PROTECTED]> wrote:
Christian Schneider wrote:> On 4/25/06, Michael Radziej <[EMAIL PROTECTED]> wrote: Christian Schneider wrote:>>> Michael,>>>
>>> I'm still using a generic view. I played with some custom functions>> before>>> and they were called so I'd hop
Christian Schneider wrote:
> On 4/25/06, Michael Radziej <[EMAIL PROTECTED]> wrote:
>>
>> Christian Schneider wrote:
>>> Michael,
>>>
>>> I'm still using a generic view. I played with some custom functions
>> before
>>> and they were called so I'd hoped that it would work with the validator
>>> ob
On 4/25/06, Michael Radziej <[EMAIL PROTECTED]> wrote:
Christian Schneider wrote:> Michael,>> I'm still using a generic view. I played with some custom functions before> and they were called so I'd hoped that it would work with the validator
> objects as well.I looked in the source. Aha! First para
Christian Schneider wrote:
> Michael,
>
> I'm still using a generic view. I played with some custom functions before
> and they were called so I'd hoped that it would work with the validator
> objects as well.
I looked in the source. Aha! First parameter to RequiredIfOtherField is
the *name* of
Michael,I'm still using a generic view. I played with some custom functions before and they were called so I'd hoped that it would work with the validator objects as well.Regardschris
On 4/25/06, Michael Radziej <[EMAIL PROTECTED]> wrote:
Christian Schneider wrote:> However, no matter what value re
Christian Schneider wrote:
> However, no matter what value recording_type has, the validator is not
> called. What I find funny is that the validator's __call__ method takes
> three values (self, field_data, all_data) while custom validator functions
> specified with validator_list take only field
Thank you very much. This is exactly what I've been looking for.
On 1/30/06, Jiri Barton <[EMAIL PROTECTED]> wrote:
> I have two text input fields in a form. At least one of them is
> required. My question is, how can I check for this?
Hi Jiri,
Check out RequiredIfOtherFieldNotGiven and RequiredIfOtherFieldsGiven
in django/core/validators.py.
Adrian
--
Adri
On 1/17/06, David S. <[EMAIL PROTECTED]> wrote:
> I have some custom validation I want only on adding a record, not changing it.
> Is there a way to qualify my _manipulator_validate_FOO() method or to find out
> from within it if it is an add or change? I know I can create a custom
> manipulator
On 1/18/06, David S. <[EMAIL PROTECTED]> wrote:
>
> I have some custom validation I want only on adding a record, not changing it.
> Is there a way to qualify my _manipulator_validate_FOO() method or to find out
> from within it if it is an add or change? I know I can create a custom
> manipulato
21 matches
Mail list logo