Sphene Community Tools

Community

Copyright © 2007-2018 by Herbert Poul

You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools
Board » General » Catchup

Hi Herbert,

I am making good progress in getting sphene working on my site.

I have a question about the catchup function in sphboard\views.py. The function has 3 params (request,group,category_id) but the group param is not used and the url doesn't seem to want 3 params. As it is it raises an error.

When remove the group command from the function definition, everything works.

Your thoughts?
Chuck
hi,

every view method in SCT requires a 'group' parameter - some have a default value predefined of 'None' since i originally planned to have wiki/board only optionally within a group ..
but i changed my mind because it's just much easier if i can assert everything is part of a Group ...

You can simply create a default group and modify your urlconf:
defaultdict = { 'groupName': 'example' }

urlpatterns = patterns('',
    (r'^board/', include('sphene.sphboard.urls'), defaultdict),
    (r'^wiki/', include('sphene.sphwiki.urls'), defaultdict),


the middleware "sphene.community.middleware.\GroupMiddleware" is then responsible for removing the 'groupName' from the request parameters and putting the loaded 'group' back into it..

another way would probably be to change the method signature to def catchup(request, category_id, group = None) - but i would prefer having a Group object..

what do you think ? is there any reason not to have at least one default group ? - see also http://sct.sphene.net/wiki/show/Tutorial/#9CreatingExampleGroup__MD_autoTOC_8
Hey, we have Signatures !!! Great, isn't it ? ;)
Hi,

I have no problem with making everything a part of a group. I just changed my urls to pass the group name. Now catchup is working with the original function definition.

Thanks,
Chuck

Please login to post a reply.



Powered by Sphene Community Tools