You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cherrypy-users
I am trying to conditonally return a resource from the index page. I
noticed that any other URL results in a 404:
# Snippet
@cherrypy.expose
class User:
def index(self, id = none):
if id:
...
else:
return "User not found"
So calls to /user work, but calls like "user/2" fail. Does the index()
function behave differently?
Thanks
Voltron
unread,
Jun 20, 2009, 9:46:26 AM6/20/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cherrypy-users
I just noticed that calls like:
"user?ide=2" work, is this a bug?
Thanks
Voltron
unread,
Jun 20, 2009, 10:27:30 AM6/20/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cherrypy-users
After a little more researching, I moved the sub resource variable to
the "default()" handler, now it works as expected. Is this correct way
to handle this problem? I did not find any documentation on this.
Thanks
fumanchu
unread,
Jun 20, 2009, 11:09:17 AM6/20/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message