[Grok-dev] Remember who added what

Peter Bengtsson peter at fry-it.com
Fri Jun 13 07:35:06 EDT 2008

I've looked at the wonderful LoginDemo grokapp and it looks like the
right thing for me to use.
However, how do I "merge" this with my models. I want each object (eg.
Comment object) to be "owned" by a user.
In Django you do it this way::

 from django.contrib.auth.models import User

class Comment(models.Model):
    user = models.ForeignKey(User, unique=False)
    title = models.CharField(max_length=100, db_index=True)

What's the Grok way of doing this?

Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com

More information about the Grok-dev mailing list