Hi guys,

I'm new to TurboGears (1 night + a few hours) and I'm looking into it
as an alternative to PHP for my website. I'm messing around with it
right now and I'm having a few difficulties. I'm trying to make a quick
blog to test out a few functionalists. Here is my model:

class BlogEntry(SQLObject):
    ''' Represents a blog entry. '''
    title  = StringCol(alternateID=True, length=200)
    entry  = StringCol()
    tg_user = ForeignKey('tg_user')
    date   = DateTimeCol(default=datetime.now)

I know what you're thinking, it's Just Another Blog (TM) -- but this is
just to try out TurboGears, what I'm actually making isn't a blog.

What I'm trying to do with this demo is have a multi-user blog. There
can be multiple users (obviously) and each user can have multiple blogs
with a blog index for that user via app-root/blog/username/ so I'm
figuring I'm looking for a method something like byUserId which I tried
but didn't work.

Here is what I desire in controllers.


Class Root(controllers.RootController):
    # abridged
    def blog(self, username):
        # something here..., but essentially
        return dict(BlogEntry.byUserId(username))


I'm not sure where to begin but I imagine someone out there knows off
the top of their head! I'm a fairly competent programmer so even if you
point me in the right direction I'm sure I'll figure it out.

Thanks!
-Sam


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to