Awesome optional features

  1. Optional integration with django_filter:

django-filter

To enable this awesome feature, add filterset_class to your Django admin:

from semantic_forms.filters import SemanticFilterSet

class DemoFilter(SemanticFilterSet):
    class Meta:
        model = Demo
        fields = ("demo_field",)

class DemoAdmin(SemanticModelAdmin):
    filterset_class = DemoFilter
  1. HTML preview in Django `autocomplete_fields`:

html5-autocomplete

To enable this awesome feature, add the semantic_autocomplete property to your Django model:

class DemoModel(models.Model):
    @property
    def semantic_autocomplete(self):
        html = self.get_img()
        return format_html(html)
  1. Optional integration with django-import-export:

django-import-export

To enable this awesome feature, instead of ImportExportModelAdmin, etc:

from import_export.admin import ImportExportModelAdmin 

class ExampleImportExportAdmin(ImportExportModelAdmin):
    pass

Inherit from their Semantic equivalents:

from semantic_admin.contrib.import_export.admin import SemanticImportExportModelAdmin

class ExampleImportExportAdmin(SemanticImportExportModelAdmin):
    pass