Source

django-helper / django_helper / templates / admin / django_helper / model.txt

Full commit
1
2
3
4
5
6
7
8
9
from django.db import models

class {{model}}(models.Model):{% for field in model.field_set.all %}
    {{field}} = models.{{field.field_type}}({{field.get_field_options}}){% endfor %}
    def __unicode__(self):
        return {% if model.unicode %}u"%s" % self.{{model.unicode}}{% else %}{{model.unicode_str}}{% endif %}
    @models.permalink
    def get_absolute_url(self):
        return {{model.absolute_url}}