Django models

Category: /knowledge /django
Tags: django

常用的声明

from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _

from datetime import datetime
from tagging.fields import TagField

in class

tags = TagField()

Meta

class Meta:
    verbose_name_plural = _('News')
    ordering = ('-publish_at', 'title')

讨论

提示

  • 如果看不到讨论部分, 请暂时关掉adblock in Firefox/Chrome
  • 本网站使用Javascript实现评论功能, 此处外链对提高您的网站PR没有帮助. (潜台词: 请不要灌水, 谢谢)