﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6688	Methods of fieldless model can't be called in templates	sam_cel	nobody	"I'm trying to write a wiki-like app and use SVN revision 7186.

models.py:
{{{
class Article(Model):
	class Admin:
		pass
	def __unicode__(self):
		return str(self.pk)
	def get_absolute_url(self):
		return ""/pages/"" + self.pk + ""/""

class ArticleEdit(Model):
	author = ForeignKey(User, related_name = ""contributions"")
	[...all other data...]
	article = ForeignKey(Article, related_name = ""edits"")
}}}
views.py:
{{{
def index(request):
        article = Article.objects.all()[0]
        return render_to_response(""index.html"", { ""article"" : article, })
}}}

The Article model is just used to tie the edits together.
I ran into two problems:

1) when I'm passing an Article-object to a template, {{{ {{ article.pk }} }}} '''always''' returns 1 and {{{ {{ article.get_absolute_url }} }}} doesn't exist.

2) http://code.djangoproject.com/ticket/1972
That ticket was WONTFIXed, but obviously people keep running into this problem. I can't think of any clean way to model the above scenario with django, so maybe ticket 1972 should be reconsidered as well."		closed	Database layer (models, ORM)	dev		invalid			Unreviewed	0	0	0	0	0	0
