I am facing a strange road block in my django Admin.
when i am using inline=[inlineFunction]
Then it fires process status aborted error.
Here is my code..
class ApplicationInline(admin.TabularInline): """ inline class Application """ model = Application show_change_link = True extra = 0 list_per_page = 2 def formfield_for_dbfield(self, db_field, **kwargs): if db_field.name == 'logo': request = kwargs.pop("request", None) kwargs['widget'] = AdminApplicationLogoWidget return db_field.formfield(**kwargs) return super(ApplicationInline, self).formfield_for_dbfield(db_field, **kwargs) class CategoryAdmin(admin.ModelAdmin): """ custom Admin Class for category model """ list_display = ['name_row_1', 'create_date', 'hospital', 'speciality', 'sort_order'] search_fields = ['name_row_1', 'hospital__name', 'speciality__name'] inlines = [ApplicationInline] list_per_page = settings.ADMIN_PAGE_SIZE class Media: js = ( 'v1/js/jquery.min.js', 'v1/js/inline/function_categories.js' ) def formfield_for_dbfield(self, db_field, **kwargs): if db_field.name == 'logo': request = kwargs.pop("request", None) kwargs['widget'] = AdminCategoryLogoWidget return db_field.formfield(**kwargs) return super(CategoryAdmin, self).formfield_for_dbfield(db_field, **kwargs) # Default Select Options in Action BLANK_CHOICE_DASH = [("", "Select options")] def get_action_choices(self, request, default_choices=BLANK_CHOICE_DASH): """ Return a list of choices for use in a form object. Each choice is a tuple (name, description). """ choices = [] + default_choices for func, name, description in six.itervalues(self.get_actions(request)): choice = (name, description % model_format_dict(self.opts)) choices.append(choice) return choices
When i add inlines = [ApplicationInline]
in my code then on browser page loads again and again.
On my local server it works fine.
My problem is : When i click on save button then browser only loading again and again and not doing any action.
I think this is not code problem because code is running on my local server(windows machine) but on client server only on a single page that error occurs. I don't know what is error. Because not any fault in my code. Not any error show in console.
Client server is AWS/Linux.
Acc. to me, this error occurs in admin section only on linux server, Not any other server. I check same code run on other server that's working. But only not working on AWS/linux server.
0 comments:
Post a Comment