开发者

How to save custom (manipulated) data to the database

I'd like to perform some manipulation (simple math) to the posted data and save it to the db, via custom save method... I've used the inlineformset_factory (parent child table..., foreign key...) But I'd like to save the manipulated part of the data into the parent table... Now as far as I can understand the parent table gets saved first (because of pk, which is used a开发者_开发知识库s fk on the child table). How can I make this work? I've added the custom save method to the model (where I do all the manipulation). I've tried with commit=False...And I could find an example of similar usage...

Any pointers would be great

Thanks!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜