disbi.admin module

Useful admin classes and factory function that can be used to configure the admin of the concrete app.

class disbi.admin.DisbiMeasurementAdmin(model, admin_site)[source]

Bases: disbi._import_export.admin.RelatedImportExportModelAdmin

Allow measurement models to be filtered by their related experiments.

filter_for_extended_form = None
list_filter = (('experiment', <class 'django.contrib.admin.filters.RelatedOnlyFieldListFilter'>),)
list_per_page = 30

Factory for creating a mixin that replaces entries globally in an uploaded dataset.

Parameters:replace (tuple) – A 2-tuple with the old and the new value.
Returns:Dataset – The new dataset with the replaced values.
disbi.admin.disbiresource_factory(mymodel, myfields, myimport_id_fields, mywidgets=None)[source]

Return a resource class with the given meta options and the validation hook.

disbi.admin.inline_factory(proxy, inline_type='tabular')[source]

Create an inline class from a proxy Model.

Parameters:proxy (Model) – The proxy or just the normal model from which the inline class is created.
Keyword Arguments:
 inline_type (str) – The type of Inline that should be created. Defaults to ‘tabular’.
Returns:InlineModelAdmin – The created class.