equal
deleted
inserted
replaced
109 .. sourcecode:: python |
109 .. sourcecode:: python |
110 |
110 |
111 class CompositionDateFacet(DateRangeFacet): |
111 class CompositionDateFacet(DateRangeFacet): |
112 # 1. make sure this facet is displayed only on Track selection |
112 # 1. make sure this facet is displayed only on Track selection |
113 __select__ = DateRangeFacet.__select__ & implements('Track') |
113 __select__ = DateRangeFacet.__select__ & implements('Track') |
114 # 2. give the facet an id ._cwuired by CubicWeb) |
114 # 2. give the facet an id required by CubicWeb) |
115 id = 'compdate-facet' |
115 id = 'compdate-facet' |
116 # 3. specify the attribute name that actually stores the date in the DB |
116 # 3. specify the attribute name that actually stores the date in the DB |
117 rtype = 'composition_date' |
117 rtype = 'composition_date' |
118 |
118 |
119 And that's it, on each page displaying tracks, you'll be able to filter them |
119 And that's it, on each page displaying tracks, you'll be able to filter them |