django - why save_model method doesn't work in admin.StackedInline? -


I have a similar problem as the problem of the first solution, this time does not seem to work in addition to the solution :

First I used to save the user to override save_model. Now I need to do this for comments, it does not work anymore.

Anyone have any ideas?

Thanks a lot!

Jason

not saved in the inlineadmin's save_form You must see save_formsets in ModelAdmin, which is related to inline:

  class MyAdmin (admin.ModelAdmin): inlines = [MyInlineAdmin, ..... ] Def save_formset (auto, request, form, format, change): formset.save () if not change: in formset.forms for f: obj = f.instance obj.user = request.user obj.save () < / Code> 

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -