5👍
admin.TabularAdmin
does not have a get_form
method.
The get_form
function you defined is never being called.
You might want to look into get_formset
method.
5👍
Inspired from the docs, I have implemented the following solution:
class Invoice(admin.ModelAdmin)
form = InvoiceForm
inlines = [InvoiceDetail,]
def get_formsets_with_inlines(self, request, obj=None):
for inline in self.get_inline_instances(request, obj):
inline.form.current_user = request.user
yield inline.get_formset(request, obj), inline
- [Django]-Creating SubCategories with Django Models
- [Django]-Successful Django Deploy Through AWS Elastic Beanstalk, But Getting 500 ERROR
- [Django]-What is the best way to consume a django-piston REST API from a Django view?
- [Django]-How can I add a class atribute to django auth login form?
- [Django]-Adding days to a date via the ORM
Source:stackexchange.com