beat.web.libraries.admin module

class beat.web.libraries.admin.LibraryModelForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

model

alias of beat.web.libraries.models.Library

exclude = []
widgets = {'short_description': <django.forms.widgets.TextInput object>}
clean_declaration_file()[source]

Cleans-up the declaration_file data, make sure it is really new

clean()[source]

Cleans-up the input data, make sure it overall validates

base_fields = {'author': <django.forms.models.ModelChoiceField object>, 'declaration_file': <beat.web.ui.forms.CodeMirrorJSONFileField object>, 'description_file': <beat.web.ui.forms.CodeMirrorRSTFileField object>, 'fork_of': <django.forms.models.ModelChoiceField object>, 'language': <django.forms.fields.TypedChoiceField object>, 'name': <beat.web.ui.forms.NameField object>, 'previous_version': <django.forms.models.ModelChoiceField object>, 'referenced_libraries': <django.forms.models.ModelMultipleChoiceField object>, 'shared_with': <django.forms.models.ModelMultipleChoiceField object>, 'shared_with_team': <django.forms.models.ModelMultipleChoiceField object>, 'sharing': <django.forms.fields.TypedChoiceField object>, 'short_description': <django.forms.fields.CharField object>, 'source_code_file': <beat.web.ui.forms.CodeMirrorPythonFileField object>, 'usable_by': <django.forms.models.ModelMultipleChoiceField object>, 'usable_by_team': <django.forms.models.ModelMultipleChoiceField object>, 'version': <django.forms.fields.IntegerField object>}
declared_fields = {'declaration_file': <beat.web.ui.forms.CodeMirrorJSONFileField object>, 'description_file': <beat.web.ui.forms.CodeMirrorRSTFileField object>, 'name': <beat.web.ui.forms.NameField object>, 'source_code_file': <beat.web.ui.forms.CodeMirrorPythonFileField object>}
property media
beat.web.libraries.admin.rehash_library(modeladmin, request, queryset)[source]

Recalculates the hash of a library

class beat.web.libraries.admin.Library(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('id', 'author', 'name', 'version', 'short_description', 'creation_date', 'previous_version', 'fork_of', 'sharing', 'hash')
search_fields = ['author__username', 'name', 'short_description', 'previous_version__author__username', 'previous_version__name', 'fork_of__author__username', 'fork_of__name']
list_filter = ['sharing']
readonly_fields = ['hash', 'short_description']
actions = [<function rehash_library>]
form

alias of LibraryModelForm

filter_horizontal = ['shared_with', 'shared_with_team', 'usable_by', 'usable_by_team', 'referenced_libraries']
fieldsets = ((None, {'fields': ('name', 'author')}), ('Documentation', {'classes': ('collapse',), 'fields': ('short_description', 'description_file')}), ('Versioning', {'classes': ('collapse',), 'fields': ('version', 'previous_version', 'fork_of')}), ('Sharing', {'classes': ('collapse',), 'fields': ('sharing', 'shared_with', 'shared_with_team', 'usable_by', 'usable_by_team')}), ('Cached Information (read-only)', {'classes': ('collapse',), 'fields': ('referenced_libraries',)}), ('Definition', {'fields': ('hash', 'declaration_file', 'language', 'source_code_file')}))
property media