Category "django-admin"

How do I filter models from the Django admin sidebar while keeping them on their children's change page form?

I have a setup that looks like this: Because 'Charities' and 'Interventions' aren't meant to be edited except from the Evaluations and Max Impact Fund Grants p

How to hide the Token model from rest_framework.authtoken in django admin panel

I tried to solve the problem using this two methods from rest_framework.authtoken.models import Token admin.site.unregister(Token) ----- from rest_framework.aut

unhashable type 'list' when i enter on change_list in Django

I search for days for a solution for this problem. after touching the admin.py file to override the get_queryset and get_form methods I ran into the unhashable

How to prevent django admin login and logout sessions from reflecting in actual website?

I'm quite new to django. I've made a website that makes use of user auth for login, logout and registration. Whenever I log into the admin panel, it also gets r

How to change add another[object] behavior in TabularInline

I want to make an admin InlineTabular add another object button and take me to the object add page with prepopulated fields instead of creating an inline model

I have an error about smart_text after installing django-admin-charts

I want to have charts in the admin panel, I installed the django-admin-charts package, Which said add these to settings.py INSTALLED_APPS = ( 'admin_to

Django admin: section in app without creating a model

I need a custom section of application on admin site. It must not consider any model (proxy, unmanaged, etc), without template overriding, just a "phantom" appl

How allow to fit read_only field for new record in TabularInline class in Django

I want to have a field readonly when record already saved but if admin adds a new record field must to be editable. How I can achieve it?

Is it possible to allow to create objects from the list_display view of the django admin site?

I have a model with fields name, roll_no, birth_date I am using the django admin's list display and list editable to have these fields displayed and edited in a

Django - Hide labels in inline

How to hide labels in Django inlines?

Django - Display in inline random info without relation to any model

Imagine there is a model: class OrgUnit(models.Model): name = models.CharField(...) type = models.CharField(...) address = models.TextField(...)

Allow empty foreign key selection in admin forms

I created a model(AnalysisFieldTemplate) with a foreign key to AnalysisFieldRule. What i want is to have the possibility to leave the field display_analysis_fie

unique=True gives already exist! Even if interchanging the values of two objects

To display objects (members) in particular order, I have made a field, order: order = models.IntegerField(unique=True,null=True,blank=True) so that I can do an

How to add a calculated field to a django admin inline

I am trying to add a calculated field to a Django Admin Inline. Consider this set of classes: models.py: class MyGroup(models.Model): group_name = models.Cha

Django Decimal field with value Decimal(0.00) is displayed as 0E-10 in the Django Admin Inline

Django 2.2. Model Definition. class BlockPeriod(BaseModel): price = models.DecimalField(max_digits=20, decimal_places=10) margin = models.DecimalField(m

Add a link to custom django admin view

I've created a custom admin view as documented here. class MyAdmin(admin.ModelAdmin): def get_urls(self): urls = super().get_urls() my_urls

How to enable django admin sidebar navigation in a custom view?

I have a view inheriting from LoginRequiredMixin, TemplateView, which renders some data using the admin/base_site.html template as the base. I treat it as a par

How to filter choices in Django2's autocomplete_fields?

In Django 2.0, autocomplete_fields was added, which is great. Without autocomplete_fields, I can change the queryset of a ForeignKeyField using formfield_for_f

Private Object Field in Django Admin

I'm wondering what the best way to have an editable field (by admins) for some object in Django admin that can't be viewable on the public site. For example, a

Why my Django admin is not loading with css?

I have developed a web app in Django and deployed it then I found out that admin page is not loading with CSS. I was gettting the admin page with css in local s