Index: charmworld/forms/featured.py |
=== modified file 'charmworld/forms/featured.py' |
--- charmworld/forms/featured.py 2013-04-17 15:03:35 +0000 |
+++ charmworld/forms/featured.py 2014-02-18 15:59:26 +0000 |
@@ -10,7 +10,23 @@ |
SchemaNode, |
) |
+from charmworld.search import BUNDLE |
+ |
+ |
+def get_schema(kind): |
+ """Based on the kind return the right schema.""" |
+ if kind == BUNDLE: |
+ return BundleFeaturedness() |
+ return CharmFeaturedness() |
+ |
class CharmFeaturedness(MappingSchema): |
- is_featured = SchemaNode(Boolean(), title='Feature this charm', |
- missing=False) |
+ is_featured = SchemaNode( |
+ Boolean(), title='Feature this charm', |
+ missing=False) |
+ |
+ |
+class BundleFeaturedness(MappingSchema): |
+ is_featured = SchemaNode( |
+ Boolean(), title='Feature this bundle', |
+ missing=False) |