On 10/02/2019 6:22 pm, Nick Emery wrote:
I am trying to wrap up my first app using Django (specifically Django
Rest Framework which may change the save behavior), but have run into
an issue that I haven't been able to solve for about 10 hours now.
I am trying to override the save() method of
UPDATE: Finally figured it out! I ultimately did this by overriding
`perform_create()` in my [Django Rest Framework
view](https://www.django-rest-framework.org/api-guide/generic-views/) and
making my changes after saving the object.
On Sunday, February 10, 2019 at 8:34:44 AM UTC-5, Nick Emery
The child objects are created separately beforehand with NULL parents (they
don't have to have parents, they can be orphans). One other thing I noticed
is that looking at the SQL statements executed by my app I can't even see
the UPDATE on the foreign keys of the children (even though I KNOW
And how?
On Sun, 10 Feb, 2019, 9:23 PM Shashank Singh When do you create child objects??
>
> On Sun, 10 Feb, 2019, 9:17 PM Nick Emery
>> Tried this too but save() never actually gets called on the child (it
>> seems that the foreign key field of the child is updated at the database
>> level and
When do you create child objects??
On Sun, 10 Feb, 2019, 9:17 PM Nick Emery Tried this too but save() never actually gets called on the child (it
> seems that the foreign key field of the child is updated at the database
> level and never goes through the Django orm Child).
>
> On Sunday,
Tried this too but save() never actually gets called on the child (it seems
that the foreign key field of the child is updated at the database level
and never goes through the Django orm Child).
On Sunday, February 10, 2019 at 8:37:54 AM UTC-5, Shashank Singh wrote:
>
> Override the save() of
Override the save() of the child?
On Sun, 10 Feb, 2019, 7:04 PM Nick Emery I am trying to wrap up my first app using Django (specifically Django
> Rest Framework which may change the save behavior), but have run into an
> issue that I haven't been able to solve for about 10 hours now.
>
> I am
I am trying to wrap up my first app using Django (specifically Django Rest
Framework which may change the save behavior), but have run into an issue
that I haven't been able to solve for about 10 hours now.
I am trying to override the save() method of a model to modify a field on a
bunch of
8 matches
Mail list logo