Closed rldiao closed 3 years ago
Hey! I'm just trying to understand the use case, but also looking at the code sample I see the Bar is title-cased in one instance. Am I just to assume that this is a typo in your example, and not the cause of your problem?
Yeah that would just be a typo. I'm basically trying validate if you can create or update the object based on a related object's field.
So in the case of you trying to change foo
but now()
is greater than bar.time
, then validate
will raise a ValidationError
And have you seen the writable foreign keys section, here?
After some thought, I've decided to pursue a different solution to my problem. Thanks for the support
Hi,
I'm currently using this library with DRF 3.12 and trying to perform some validations in the serializer by checking a related object.
Something like this:
This code works when
Bar
is specified infields
but notexpandable_field
. Just asking if the object is stored somewhere where I can assess?Thanks