File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -436,6 +436,24 @@ def __repr__(self):
436436 def atom_timestamp (self ):
437437 return self .timestamp .strftime ('%Y-%m-%dT%H:%M:%S+00:00' ) or ''
438438
439+ @property
440+ def custom_extra_fill (self ):
441+ out = []
442+ for col_id in cc_classes :
443+ val = getattr (self , 'custom_column_' + str (col_id ), None )
444+ if val :
445+ col_def = CalibreDB .session_factory ().query (CustomColumns ).filter (CustomColumns .id == col_id ).first ()
446+ name = col_def .name if col_def else "Column {}" .format (col_id )
447+ values = val if isinstance (val , list ) else [val ]
448+ for item in values :
449+ if hasattr (item , 'value' ):
450+ out .append ({
451+ 'name' : name ,
452+ 'value' : item .value
453+ })
454+ return out
455+
456+
439457 @property
440458 def isbn (self ):
441459 for identifier in self .identifiers :
Original file line number Diff line number Diff line change 6363 term =" {{tag.name}}"
6464 label =" {{tag.name}}" />
6565 {% endfor %}
66+ {% for cc in entry.Books.custom_extra_fill %}
67+ <category scheme =" custom_column:{{cc.name}}"
68+ term =" {{cc.name}}"
69+ label =" {{cc.value}}" />
70+ {% endfor %}
6671 {% if entry.Books.comments[0] %}<summary >{{entry.Books.comments[0].text|striptags}}</summary >{% endif %}
6772 {% if entry.Books.has_cover %}
6873 <link type =" image/jpeg" href =" {{url_for('opds.feed_get_cover', book_id=entry.Books.id)}}" rel =" http://opds-spec.org/image" />
You can’t perform that action at this time.
0 commit comments