u/initsbriliance

▲ 10 r/django

Brilliance Admin Panel - added django support

This is a plug-in admin panel built on vue + vuetify

Live Demo | Docs + Showcase | Github

Demo location - Germany

New 0.45.19 features - formsets, inlines, and subcategories.

I'm doing it now for use in my own products, but if anyone is interested and uses it, I'll be glad, and suggestions are welcome.

CRUD category example:

from brilliance_admin import schema, django

class UserAdmin(django.DjangoAdmin):
    model = User

    slug = 'users'
    title = 'Users'
    icon = 'mdi-account'

    search_fields = ['username', 'email']
    ordering_fields = ['id', 'created_at']

    table_schema = django.DjangoFieldsSchema(model=User)
    table_filters = django.DjangoFieldsSchema(
        model=User,
        created_at=schema.DateTimeField(range=True),
    )

The main feature is the ease of adding actions to entries. Custom action example:

    @admin_action(
        title=_("password.change_password"),
        form_schema=schema.FieldsSchema(
            new_password=schema.StringField()
        ),
    )
    async def change_password(self, action_data: ActionData):
        new_password = action_data.form_data["new_password"]
        hashed_password = UserDAO.hash_password(new_password)
  
        await User.objects.filter(pk__in=action_data.pks).aupdate(password=hashed_password)
  
        return ActionResult(message=ActionMessage(_("password.password_changed")))
reddit.com
u/initsbriliance — 4 days ago