Correction: # model db.py
from applications.plugin_t2.modules.t2 import T2 db=SQLDB('sqlite://storage.db') db.define_table('thread',SQLField('title')) t2=T2(request,response,session,cache,T,db) db.thread.represent=lambda thread: \ A(thread.title,_href=t2.action('thread',thread.id)) #controller default.py def login(): return dict(form=t2.login()) def register(): return dict(form=t2.register()) def logout(): t2.logout(next='login') def download(): return t2.download() @t2.requires_login() def index(): return dict(form=t2.create(db.thread), threads=t2.search(db.thread)) @t2.requires_login() def thread(): return dict(thread=t2.display(db.thread), comments=t2.comments(db.thread)) If you give it a try and write good looking views, please share it with us. Massimo On Nov 5, 6:11 pm, mdipierro <[EMAIL PROTECTED]> wrote: > You can create a minimalist forum with this code: > > # model db.py > > from applications.plugin_t2.modules.t2 import T2 > db=SQLDB(...) > db.define_table('thread',SQLField('title')) > db.thread.represent=lambda thread: > A(thread.title,_href=t2.action('thread',thread.id)) > t2=T2(request,response,session,cache,T,db) > > #controller default.py > > def login(): return dict(form=t2.login()) > def register(): return dict(form=t2.register()) > def logout(): t2.logout(next='login') > def download(): return t2.download() > def index(): > return > dict(form=t2.create(db.thread),threads=t2.search(db.thread)) > > def thread(): > return > dict(thread=t2.display(db.thread),comments=t2.comments(db.thread)) > > Massimo > > On Nov 5, 5:00 pm, Baron <[EMAIL PROTECTED]> wrote: > > > hello, > > > just very basic - users, forums, threads, posts, but nice looking. > > The chatroom app has users, threads, posts, and a good layout, so it > > seems mostly there. > > > But you suggest t2? I'll have a look into this. > > > Richard > > > On Nov 5, 6:23 pm, mdipierro <[EMAIL PROTECTED]> wrote: > > > > could you list the features you requires? > > > > You can probably write one in t2 using {{=t2.comments()}} > > > > Massimo > > > > On Nov 4, 10:39 pm, Baron <[EMAIL PROTECTED]> wrote: > > > > > hello, > > > > > I'm looking for a simple forum app but there aren't any in the > > > > appliances page:http://mdp.cti.depaul.edu/appliances > > > > Does anyone know of an existing web2py forum app? > > > > > Or alternatively, would one of the existing applications be relatively > > > > easy to convert to a forum? Perhaps the chat room? > > > > > thanks, > > > > Richard --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---