[cmsiki-svn] SF.net SVN: cmsiki: [24] trunk/cmsiki
Status: Pre-Alpha
Brought to you by:
cnu
From: <cn...@us...> - 2007-04-04 17:57:22
|
Revision: 24 http://cmsiki.svn.sourceforge.net/cmsiki/?rev=24&view=rev Author: cnu Date: 2007-04-04 10:57:21 -0700 (Wed, 04 Apr 2007) Log Message: ----------- Added doc strings to models rearranged apps in admin interface added getLink markup tag to cmsikireplace Modified Paths: -------------- trunk/cmsiki/apps/blogroll/models.py trunk/cmsiki/apps/page/models.py trunk/cmsiki/apps/story/models.py trunk/cmsiki/cmsikireplace.py trunk/cmsiki/settings.py Modified: trunk/cmsiki/apps/blogroll/models.py =================================================================== --- trunk/cmsiki/apps/blogroll/models.py 2007-04-02 18:07:33 UTC (rev 23) +++ trunk/cmsiki/apps/blogroll/models.py 2007-04-04 17:57:21 UTC (rev 24) @@ -3,6 +3,7 @@ # Create your models here. class Blog(models.Model): + '''To create a list of links to weblogs and other related websites.''' name = models.CharField(maxlength=50) url = models.URLField(verify_exists=False) description = models.CharField(maxlength=100, blank=True) Modified: trunk/cmsiki/apps/page/models.py =================================================================== --- trunk/cmsiki/apps/page/models.py 2007-04-02 18:07:33 UTC (rev 23) +++ trunk/cmsiki/apps/page/models.py 2007-04-04 17:57:21 UTC (rev 24) @@ -20,6 +20,7 @@ class Page(models.Model): + '''The Page model allows a way to create permanent pages in the website which can be accessed by using the slug field.''' title = models.CharField(maxlength=150) body = models.TextField() slug = models.SlugField(prepopulate_from=('title',)) Modified: trunk/cmsiki/apps/story/models.py =================================================================== --- trunk/cmsiki/apps/story/models.py 2007-04-02 18:07:33 UTC (rev 23) +++ trunk/cmsiki/apps/story/models.py 2007-04-04 17:57:21 UTC (rev 24) @@ -5,6 +5,7 @@ # Create your models here. class Category(models.Model): + '''To categorise the stories under a single category. Will be accessed by the slug field.''' name = models.CharField(maxlength=50) description = models.CharField(maxlength=200) slug = models.SlugField(prepopulate_from=('name',)) @@ -16,6 +17,9 @@ list_display = ('name', 'description', 'slug') class Story(models.Model): + '''A model for creating news articles in the website. + + This is sorted by reverse chronological order and belongs to a single Category. Accessible using the date published and the slug field.''' title = models.CharField(maxlength=150) body = models.TextField() category = models.ForeignKey(Category) Modified: trunk/cmsiki/cmsikireplace.py =================================================================== --- trunk/cmsiki/cmsikireplace.py 2007-04-02 18:07:33 UTC (rev 23) +++ trunk/cmsiki/cmsikireplace.py 2007-04-04 17:57:21 UTC (rev 24) @@ -100,10 +100,26 @@ %(page_info['name'], page_info['author'], page_info['version']) return str(page_string_info) +def getLink(tag): + '''Returns the URL of the page in a particular wiki.''' + page_pattern = re.compile(':\w+@') + wiki_pattern = re.compile('@[a-zA-Z]+\]') + page_match = page_pattern.findall(tag)[0] + page_name = page_match[1:-1] + wiki_match = wiki_pattern.findall(tag)[0] + wiki_name = wiki_match[1:-1] + try: + wiki = wikirpc(wiki_name) + except WikiNameError: + return '' + wikiurl = wiki['url'] + page_name + return "<a href=\"%s\">%s</a>" %(wikiurl, page_name) + dict_func = {'getPage':getPage, 'getPageHTML':getPageHTML, - 'getPageInfo':getPageInfo + 'getPageInfo':getPageInfo, + 'getLink':getLink, } Modified: trunk/cmsiki/settings.py =================================================================== --- trunk/cmsiki/settings.py 2007-04-02 18:07:33 UTC (rev 23) +++ trunk/cmsiki/settings.py 2007-04-04 17:57:21 UTC (rev 24) @@ -71,9 +71,9 @@ 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', + 'cmsiki.apps.page', + 'cmsiki.apps.story', 'django.contrib.comments', - 'cmsiki.apps.story', - 'cmsiki.apps.page', 'cmsiki.apps.blogroll', ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |