コード例 #1
0
ファイル: forms.py プロジェクト: benoitc/mt-compono
    def __init__(self, *args, **kwargs):
        super(CreateDocument, self).__init__(*args, **kwargs)
        choices = [(t._id, t.name) for t in Type.all()]
        
        self.fields['ptype'].choices = choices

            
        
コード例 #2
0
ファイル: type.py プロジェクト: benoitc/mt-compono
def all_types(request):
    """ list all types """
    if not can_create(request.user):
        return HttpResponseForbidden()
    
    types = Type.all()
    return render_to_response("types/types.html", {
        "types": types
    }, context_instance=RequestContext(request))
コード例 #3
0
ファイル: forms.py プロジェクト: benoitc/mt-compono
 def __init__(self, *args, **kwargs):
     super(CreatePageType, self).__init__(*args, **kwargs)
     choices = [
                     ('type', _(u"Créer une page et un nouveau type")),
                     ('context', _(u'Créer un contexte')),
                     ('--', '--'),
                     ('--', _(u'Créer une page à partir du type :')),
                     ('--', '--'),
                 ]
     choices += [(t._id, t.name) for t in Type.all()]
     
     self.fields['page_type'].choices =choices