Sphene Community Tools


Copyright © 2007-2018 by Herbert Poul

You are not logged in.

Change Language:

AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools
Board » General » SPH_SETTINGS?

Page: Previous 1 2

Well apparently {{ snip.get_absolute_editurl }} is returning the show url instead of the edit url and I have no idea why. I took a look at your models and the Snip get_absolute_editurl function looks OK - of course I'm not entirely sure why you're doing it the way you're doing it (I guess I'm kinda a noob)--

    def get_absolute_editurl(self):
        return ('sphene.sphwiki.views.editSnip', (), { 'groupName': self.group.name, 'snipName': self.name })
    get_absolute_editurl = permalink(get_absolute_editurl, get_current_request)

After looking at this code and figuring out what permalink is and where it comes from I understand what you're doing - maybe my URLconf is wrong? I really don't have a good grip on what permalink does yet either -- just read a blog post describing what it's supposed to do and it only used one argument to the function instead of two -- what does adding get_current_request buy you?
What? You wanted a sig?
ah.. maybe you haven't applied the 'permalink_with_additional_function_arg.diff' - patch ? http://code.djangoproject.com/ticket/3530

unfortunately this is still required.. since the django developers seem to be quite busy i think i'll put my version of perma link into the SCT codebase until they've added it to the django codebase (if they decide to do so) ..

the http://code.djangoproject.com/ticket/3530 describes what the second argument is for .. it is a function which will return the current request object.. from which to retrieve the URL config ....

this is necessary because SCT allows it to have virtual hosts on the same installation.. like this website.. and .. http://chs.sphene.net/ (which .. has no content.. so nothing to see there...) .. - this is handled by the sphene.community.middleware.MultiHostMiddleware .. which i still haven't documented :( .. it basically maps URLs to SCT Group's
Hey, we have Signatures !!! Great, isn't it ? ;)
Ahh, that would probably be it; but I still don't quite understand why I'd be getting the show url out of the function instead of the edit url. I'll apply the patch and see if that fixes it, though.
What? You wanted a sig?
are you sure that the function really returns the show URL ? perhaps it renders as <a href="">..</a> which browsers would interpret as a link to the current page (which is probably the show url) ..
Hey, we have Signatures !!! Great, isn't it ? ;)
Ok, I actually had applied the patch to begin with. It's still not linking properly and I have no idea why not. :(
What? You wanted a sig?
You're right; I checked the source instead of looking at the mouseover link and it's empty.
What? You wanted a sig?
i just checked the simpleproject locally .. and.. i had the same error..
after a short debugging session .. i found the problem.. it is in my permalink patch ..

if you edit the file django/db/models/__init__.py you should find on line 36:

urlconf = getattr(urlconf, 'urlconf')

the correct function call would be:

urlconf = getattr(urlconf, 'urlconf', None)

as i said.. i should probably use my own version of permalink instead of relying on a patch.. this way i could have simply committed my changes .. it's much more complicated this way .. :(
Hey, we have Signatures !!! Great, isn't it ? ;)
Well I'm glad you figured it out -- I'll update my patch and keep on truckin. Thanks again!
What? You wanted a sig?

Page: Previous 1 2

Please login to post a reply.

Powered by Sphene Community Tools