root/docs/everes/20090425_django_hands_on_b/sample/tags/models.py @ 32772

Revision 32772, 327 bytes (checked in by everes, 5 years ago)

2009/04/25 Django-hack-a-thon, Hands on B.

Line 
1# encoding:utf-8
2from django.db import models
3from django.contrib.auth.models import User
4
5class Tag(models.Model):
6  name = models.CharField(u'タグ名', max_length=50)
7  user = models.ForeignKey(User)
8 
9  def __unicode__(self):
10    return u'%s(%s)' % (self.name, self.user)
11 
12  class Meta:
13    ordering = ['user', 'name']
Note: See TracBrowser for help on using the browser.