比方說,我已正確劃分用戶模型(CustomUser)(如此處所述:http://scottbarnham.com/blog/2008/08/21/extending-the-django-user-model-with-inheritance/) 並安裝了評論應用程序。 訪問註釋的用戶模板我寫: {{comment.user}} # which provides User, not my Cust
嘿,我想根據django中的計算值對對象進行排序......我該怎麼做? 這裏是一個基於堆棧溢出,說明我的困境的例子用戶配置模式: class Profile(models.Model):
user = models.ForeignKey(User)
def get_reputation():
...
return reputation
re