Add extensible data filtering feature allowing to remove hard coded listing of documents with missing required metadata. Closes gl-issue #178.
This commit is contained in:
@@ -9,6 +9,7 @@ from django.db import models
|
||||
from django.utils.html import escape
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from .classes import Filter
|
||||
from .models import UserLocaleProfile
|
||||
from .utils import return_attrib
|
||||
from .widgets import DetailSelectMultiple, DisableableSelectWidget, PlainWidget
|
||||
@@ -134,6 +135,14 @@ class FileDisplayForm(forms.Form):
|
||||
fd.close()
|
||||
|
||||
|
||||
class FilterForm(forms.Form):
|
||||
filter_slug = forms.ChoiceField(label=_('Field'))
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(FilterForm, self).__init__(*args, **kwargs)
|
||||
self.fields['filter_slug'].choices = Filter.all().items()
|
||||
|
||||
|
||||
class LicenseForm(FileDisplayForm):
|
||||
FILENAME = 'LICENSE'
|
||||
DIRECTORY = []
|
||||
|
||||
Reference in New Issue
Block a user