Thanks but here is my attempt at reddish code on GAE:
I have problems, any help appreciated.
chrism
model:
db.define_table("prodj",
SQLField("timestamp",'datetime',default=now),
SQLField("uuid",length=128,writable=False,default=str(uuid.uuid4
())),
SQLField("active",'boolean',default=True),
SQLField("name"))
db.define_table('discuss',
SQLField('uuid',length=128,writable=False,default=str(uuid.uuid4())),
SQLField('score','integer',default=1),
SQLField('timestamp','datetime',default=now),
SQLField('author_name',db.auth_user),
SQLField('author_alias'),
SQLField('author_email'),
SQLField('parente','integer',default=0),
SQLField('prodj',db.prodj),
SQLField('body','text'),
SQLField('flagged','boolean',default=False))
controller:
@auth.requires_login()
def show():
"shows a wiki prodj"
#try:
prodj=db(db.prodj.id==request.args[0]).select()[0]
#except: redirect(URL(r=request,f='index'))
if session.authorized:
form=SQLFORM(db.discuss,fields=['body'],labels={'body':''})
form.vars.author=session.authorized
form.vars.author_alias=session.alias
form.vars.prodj=prodj
if form.accepts(request.vars,formname='0'):
response.flash='discuss posted'
else: form=None
#try:
item=db(db.prodj.id==request.args[0]).select()[0]
discuss=db(db.discuss.prodj==prodj).select
(db.discuss.prodj,orderby=db.discuss.score)
#except: redirect(URL(r=request,f='index'))
items=[]
tree={}
forms={}
for c in discuss:
if not tree.has_key(c.parente): tree[c.parente]=[c]
else: tree[c.parente].append(c)
if session.authorized:
f=SQLFORM(db.discuss,fields=['body'],labels={'body':''})
f.vars.author=session.authorized
f.vars.author_alias=session.alias
f.vars.prodj=prodj
f.vars.parente=c.id
if f.accepts(request.vars,formname=str(c.id)):
session.flash='discuss posted'
redirect(URL(r=request,args=request.args))
forms[c.id]=f
return dict
(prodj=prodj,item=item,form=form,tree=tree,forms=forms,parent=0)
view:
taken from reddish code example
traceback:
INFO 2009-04-12 00:27:47,671 dev_appserver.py] "GET /fabmonger/
default
WARNING 2009-04-12 00:35:02,171 cache.py] no cache.disk
ERROR 2009-04-12 00:35:02,312 main.py] Traceback (most recent call
last
File "c:\apps\web2py\gluon\restricted.py", line 98, in restricted
exec ccode in environment
File "c:\apps\web2py\applications\fabmonger/controllers/default.py",
lin
File "c:\apps\web2py\gluon\globals.py", line 75, in <lambda>
self._caller = lambda f: f()
File "c:\apps\web2py\gluon\tools.py", line 989, in f
return action(*a, **b)
File "c:\apps\web2py\applications\fabmonger/controllers/default.py",
lin
discuss=db(db.discuss.prodj==prodj).select
(db.discuss.prodj,orderby=db
File "c:\apps\web2py\gluon\contrib\gql.py", line 327, in __eq__
return SQLQuery(self, '=', value)
File "c:\apps\web2py\gluon\contrib\gql.py", line 570, in __init__
right = obj_represent(right, left.type, left._db)
File "c:\apps\web2py\gluon\contrib\gql.py", line 505, in
obj_represent
obj = long(obj)
TypeError: long() argument must be a string or a number, not
'SQLStorage'
On Apr 11, 5:35 pm, mdipierro <[email protected]> wrote:
> http://groups.google.com/group/web2py/browse_thread/thread/b6a67992b9...
>
> On Apr 11, 6:03 am, murray3 <[email protected]> wrote:
>
> > Anyone created any threaded based discussion code similar to what we
> > are
> > using here now. I want to incorporate this into an Open source app I
> > am developing and
> > it needs to run on GAE.
> > I know Reddish did simething similar but it was not updated to work
> > with latest
> > version of web2py, so I am not sure if anyone has progressed this
> > code.
>
> > help always appreciated.
> > Chrism
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---