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 » Wiki revert

Page: Previous 1 2

Great ! Thank you so much :-) It works well in SCT webiste, and almost in my local configuration, the only problem is that it does not retrieve correctly the edit url link, it seem i get empty string by:

def get_absolute_editurl(self):
return reverse( 'sphwiki_editversion',

Is there any special configuration needed to get reverse() work? If i type it by hand i can edit the previous version.

Thanks again !

Camille.
It works if i provide an empty urlconf:

urlconf = None, #get_current_request().urlconf,

Is my Django site not properly configured or something worng in the revert variable?

Camille.
I added the link into the view DiffTable, quite dirt but very usefull there too:

fromdesc = sph_date( changeStart.edited ) + ' by ' + sph_fullusername( changeStart.editor ) + ' <a href="' + changeStart.get_absolute_editurl() + '">Edit this version</a> ',
todesc = sph_date( changeEnd.edited ) + ' by ' + sph_fullusername( changeEnd.editor ) + ' <a href="' + changeEnd.get_absolute_editurl() + '">Edit this version</a> ',
Camille Harang said @ 2007-12-22 00:04:45:
urlconf = None, #get_current_request().urlconf,
i have now replaced it with: getattr( get_current_request(), 'urlconf' ) - i'm pretty sure that it works now for you too ...

Camille Harang said @ 2007-12-22 00:04:45:
Is my Django site not properly configured or something worng in the revert variable?

you are either not using the \MultiHostMiddleware, or it is not correctly configured ..

you could use something like the following in settings_local.py:

SPH_HOST_MIDDLEWARE_URLCONF_MAP = {
  '.*': { 'urlconf': 'urlconfs.community_urls',
          'params' : { 'groupName': 'example' }
        }
}


(if you are using the 'communitydraft' project)
Hey, we have Signatures !!! Great, isn't it ? ;)
It works with SPH_HOST_MIDDLEWARE_URLCONF_MAP :-)

Thank you so much for this work :-)

I am not using MultiHostMiddleware or communitiy draft, just the lowest level way plugged into my django project, is it not recommended ?

Thanks again :-)

Camille.
Camille Harang said @ 2007-12-22 14:29:19:
I am not using MultiHostMiddleware or communitiy draft, just the lowest level way plugged into my django project, is it not recommended ?
sure.. you can use SCT without communitydraft.. the communitydraft project is basically just an example .. or if you need a jump start for a community website ..

but you should use the \MultiHostMiddleware .. i'm not sure if it would otherwise correctly find the community group .. but .. if it works for you now.. it's all fine ;)
Hey, we have Signatures !!! Great, isn't it ? ;)
It works without MultiHostMiddleware, i tried to activate it to see but it crashes:

AttributeError at /
'WSGIRequest' object has no attribute 'user'
Request Method: GET
Request URL: http://localhost:8080/
Exception Type: AttributeError
Exception Value: 'WSGIRequest' object has no attribute 'user'
Exception Location: sphenecoll/sphene/community/middleware.py in get_current_user, line 131

Is it a big deal not to use it ? I don't plan to have MultiHost's anyway ?
well .. the important thing is, that the application views receive a 'group' object.. if it works without the MultiHostMiddleware and just with the GroupMiddleware. it's fine ..

the exception is weird though .. anyhow .. if your wiki snips are associated with a group object.. everything is fine.. if they are not .. i'm not sure if all features work as expected..
Hey, we have Signatures !!! Great, isn't it ? ;)
Yes it works just like this, my snips are associated in the urls.py

defaultdict = { 'groupName': 'example' }
(r'^wiki/', include('sphene.sphwiki.urls'), defaultdict),

Is it enough?

Thanks again.

Camille.

Page: Previous 1 2

Please login to post a reply.



Powered by Sphene Community Tools