- 下載mptt
- 修正mptt在執行django1.0下所發生的錯誤
- 使用範例如下
3.1在model.py
from django.db import models
import mptt
class Category(models.Model):
name = models.CharField(max_length=50)
parent = models.ForeignKey('self', null=True, blank=True, related_name='children')
def __unicode__(self):
return self.name
mptt.register(Category)


沒有留言:
張貼留言