/ Published in: Python
Expand |
Embed | Plain Text
from django.forms import ModelForm def create_modelform(model_, module=None): class _modelform(ModelForm): class Meta: model = model_ if module: _modelform.__module__ = module else: _modelform.__module__ = model_.__module__ _modelform.__name__ = '%sForm' % model_.__name__ return _modelform
Comments
Subscribe to comments
You need to login to post a comment.

hi i would be glad if you suggest on my codes.thanks!