Posted by Camille Harang |
|
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. |
|
Posted by Camille Harang |
|
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. |
|
Posted by Camille Harang |
|
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> ', |
|
Posted by Herbert Poul |
|
i have now replaced it with: getattr( get_current_request(), 'urlconf' ) - i'm pretty sure that it works now for you too ...
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 ? ;) |
|
Posted by Camille Harang |
|
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. |
|
Posted by Herbert Poul |
|
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 ? ;) |
|
Posted by Camille Harang |
|
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 ? |
|
Posted by Herbert Poul |
|
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 ? ;) |
|
Posted by Camille Harang |
|
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. |