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

SCT Development Cheat sheet

Development / Cheatsheet

Back to Snip <-- Previous Change | Next Change -->

Diff Summary
Title SCT Development Cheat sheet SCT Development Cheat sheet
Date 2008-04-04 07:14:06 2008-04-04 07:15:39
Editor Herbert Poul Herbert Poul
Tags

2008-04-04 07:14:06 by Herbert Poul
2008-04-04 07:15:39 by Herbert Poul
n1 n
2# General1# General
32
4## Reverse lookup for a view -> URL3## Reverse lookup for a view -> URL
54
6### in python:5### in python:
16    {% sph_url2 view_name arg=value %}15    {% sph_url2 view_name arg=value %}
1716
18# Models17# Models
1918
20## Absolute URLs19## Absolute URLs
tt20
21    from sphene.community.middleware import get_cu
 >rrent_request
22    from sphene.community.sphutils import sphperma
 >link as permalink
23
24
25    class MyModel(models.Model):
26
27        def get_absolute_edit_url(self):
28            return ('sphene.sphblockframework.view
 >s.edit_block_config', (), { 'groupName': self.grou
 >p.name, 'bock_config_id': self.id })
29    get_absolute_edit_url = permalink(get_absolute
 >_edit_url, get_current_request)


Powered by Sphene Community Tools