from librarian.dcparser import BookInfo
from librarian.document import WLDocument
from librarian.builders import StandaloneHtmlBuilder
+from librarian.meta.types.wluri import WLURI
from librarian.meta.types.text import LegimiCategory, Epoch, Kind, Genre, Audience
from depot.legimi import legimi
VALUE_TYPES = {
LegimiCategory: {
'widget': 'select',
- 'options': list(legimi.CATEGORIES.keys()),
+ 'options': [''] + list(legimi.CATEGORIES.keys()),
},
Epoch: {
'autocomplete': {
'source': '/catalogue/terms/genre/',
}
},
+ WLURI: {
+ "autocomplete": {
+ "source": "/catalogue/terms/wluri/",
+ }
+ },
+ "authors": {
+ "autocomplete": {
+ "source": "/catalogue/terms/author/",
+ }
+ },
+ "translators": {
+ "autocomplete": {
+ "source": "/catalogue/terms/author/",
+ }
+ },
+ "editors": {
+ "autocomplete": {
+ "source": "/catalogue/terms/editor/",
+ }
+ },
+ "technical_editors": {
+ "autocomplete": {
+ "source": "/catalogue/terms/editor/",
+ }
+ },
+ "type": {
+ "autocomplete": {
+ "source": ["text"]
+ }
+ },
+ "title": {
+ "autocomplete": {
+ "source": "/catalogue/terms/book_title/",
+ }
+ },
+
+ "language": {
+ 'widget': 'select',
+ 'options': [
+ '',
+ 'pol',
+ 'eng',
+ 'fre',
+ 'ger',
+ 'lit',
+ ],
+ },
+ "publisher": {
+ "autocomplete": {
+ "source": ["Fundacja Nowoczesna Polska"]
+ }
+ },
+
}
-
+
+
class MetaTagsView(View):
def get(self, request):
fields = []
'name': f.value_type.__name__,
}
}
- d['value_type'].update(VALUE_TYPES.get(f.value_type, {}))
+ d['value_type'].update(
+ VALUE_TYPES.get(
+ f.value_type,
+ VALUE_TYPES.get(
+ f.name,
+ {}
+ )
+ )
+ )
fields.append(d)
return HttpResponse(