Ejemplo n.º 1
0
 def get(self):
     return dict(category=dict(items=get_categories()))
Ejemplo n.º 2
0
 def __init__(self, *args, **kwargs):
     super(VideoForm, self).__init__(*args, **kwargs)
     self.category.choices = [
         (sc['id'], sc['name']) for sc in
         chain(*(c['sub_categories'] for c in get_categories()))]