errrr
This commit is contained in:
@@ -1,37 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from unfold.admin import ModelAdmin
|
||||
from unfold.sections import TableSection, TemplateSection
|
||||
|
||||
from django.urls import reverse_lazy
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from .models import Account
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.firstname} {self.lastname}"
|
||||
|
||||
# # Register your models here.
|
||||
# admin.site.register(Account)
|
||||
|
||||
# Table for related records
|
||||
class CustomTableSection(TableSection):
|
||||
verbose_name = _("Keywarden Users") # Displays custom table title
|
||||
height = 300 # Force the table height. Ideal for large amount of records
|
||||
# related_name = "related_name_set" # Related model field name
|
||||
fields = ["id", "firstname", "lastname", "joined_date"] # Fields from related model
|
||||
|
||||
# # Custom field
|
||||
# def custom_field(self, instance):
|
||||
# return instance.pk
|
||||
|
||||
# # Simple template with custom content
|
||||
# class CardSection(TemplateSection):
|
||||
# template_name = "keywarden/some_template.html"
|
||||
|
||||
@admin.register(Account)
|
||||
class SomeAdmin(ModelAdmin):
|
||||
list_sections = [
|
||||
#CardSection,
|
||||
CustomTableSection,
|
||||
]
|
||||
#
|
||||
# No custom models registered in accounts app. The legacy Account model has been removed.
|
||||
Reference in New Issue
Block a user