I create custom django template and used Form (this tag has to be
universal):
This is file ratings.py use tags:
from django import template
from django.contrib.contenttypes.models import ContentType
from Ratings.forms import RatingsForm
register = template.Library()
class RatingFormNode(templa
get the model by string i use:
from django.db.models.loading import get_model
def get_model(self, app_label, model_name, seed_cache=True):
how to get ModelForm by string?
i try used:
modelforms = forms.ModelForm.__subclasses__()
def get_form(form):
try:
for model_form in modelforms
and how to get only Form (not ModelForm) use string name?
W dniu piątek, 28 czerwca 2013 22:09:41 UTC+2 użytkownik MacVictor napisał:
>
> get the model by string i use:
>
> from django.db.models.loading import get_model
> def get_model(self, app_label, model_name, seed_cache=Tr
wnik yeswanth nadella
napisał:
>
> I am afraid, I did not understand your question. Are you trying to
> generate a form based on your model/ models?
>
> On Friday, June 28, 2013 3:23:00 PM UTC-5, MacVictor wrote:
>>
>> and how to get only Form (not ModelForm) use string n
response['my_form'] = form
return render_to_response('request/window.html', response)
W dniu piątek, 28 czerwca 2013 22:09:41 UTC+2 użytkownik MacVictor napisał:
>
> get the model by string i use:
>
> from django.db.models.loading import get_model
> d
How to create this table used formset and extra=3?
Table:
| my name first column | second column | third column | fourth column |
| formset1.field1.label | formset1.field1 | formset2.field1 |
formset3.field1 |
| formset1.field2.label | formset1.field2 | formset2.field2 |
formset3.field2 |
|
6 matches
Mail list logo