Commits

Anonymous committed 52900f5 Merge

Merge

  • Participants
  • Parent commits 1eda38a, 32dfef6

Comments (0)

Files changed (47)

File appengine_django/__init__.pyc

Binary file modified.

File appengine_django/db/__init__.pyc

Binary file modified.

File appengine_django/db/base.pyc

Binary file modified.

File appengine_django/db/creation.pyc

Binary file modified.

File appengine_django/mail.pyc

Binary file modified.

File appengine_django/models.pyc

Binary file modified.

File appengine_django/replacement_imp.pyc

Binary file modified.

File appengine_django/serializer/__init__.pyc

Binary file modified.

File appengine_django/serializer/json.pyc

Binary file modified.

File appengine_django/serializer/python.pyc

Binary file modified.

File appengine_django/serializer/pyyaml.pyc

Binary file modified.

File appengine_django/sessions/backends/__init__.pyc

Binary file modified.

File context/__init__.pyc

Binary file modified.

File context/context_processors.pyc

Binary file modified.

File markdown/__init__.pyc

Binary file modified.

File markdown/blockparser.pyc

Binary file modified.

File markdown/blockprocessors.pyc

Binary file modified.

File markdown/etree_loader.pyc

Binary file modified.

File markdown/html4.pyc

Binary file modified.

File markdown/inlinepatterns.pyc

Binary file modified.

File markdown/odict.pyc

Binary file modified.

File markdown/postprocessors.pyc

Binary file modified.

File markdown/preprocessors.pyc

Binary file modified.

File markdown/treeprocessors.pyc

Binary file modified.

File pages/__init__.pyc

Binary file modified.

File pages/contactform.pyc

Binary file modified.

File pages/models.pyc

Binary file modified.

File pages/pageform.py

 
 
 class PageForm(forms.Form):
-    name = forms.CharField(max_length=100)
-    description = forms.CharField(max_length=300, required=False)
+    name = forms.CharField(max_length=100,widget=forms.TextInput(attrs={'class':'textInput'}))
+    description = forms.CharField(max_length=300, required=False,widget=forms.TextInput(attrs={'class':'textInput'}))
     body = forms.CharField(widget=forms.Textarea)
-    template = forms.CharField(max_length=30)
-    navbar = forms.BooleanField(required=False)
-    publish = forms.BooleanField()
+    template = forms.CharField(max_length=30,widget=forms.TextInput(attrs={'class':'textInput'}))
+    navbar = forms.BooleanField(required=False, widget=forms.Select(choices=(('True','True'),
+                                                                             ('False', 'False'))))
+    publish = forms.BooleanField(widget=forms.Select(choices=(('Published','Publish Now'),
+                                                              ('Private','Private'),
+                                                              ('Draft','Draft'))))
 
     def save(self, page=None, commit=True):
         data = self.cleaned_data

File pages/pageform.pyc

Binary file modified.

File pages/views.pyc

Binary file modified.

File posts/__init__.pyc

Binary file modified.

File posts/models.pyc

Binary file modified.

File posts/postform.py

 
 
 class PostForm(forms.Form):
-    title = forms.CharField(max_length=100)
-    body = forms.CharField(widget=forms.Textarea)
-    category = forms.CharField(max_length=30)
-    tags = forms.CharField()
+    title = forms.CharField(max_length=100,widget=forms.TextInput(attrs={'class':'textInput'}))
+    body = forms.CharField(widget=forms.Textarea())
+    category = forms.CharField(max_length=30,widget=forms.TextInput(attrs={'class':'textInput'}))
+    tags = forms.CharField(widget=forms.TextInput(attrs={'class':'textInput'}))
 
     def save(self, post=None, commit=True):
         data = self.cleaned_data

File posts/postform.pyc

Binary file modified.

File posts/rss.py

+from django.contrib.syndication.views import Feed
+from posts.models import Post
+from django.conf import settings
+
+from google.appengine.api import memcache
+
+
+class LatestFeed(Feed):
+	title = settings.BLOG_TITLE
+	link = settings.SITE_URL
+	description = 'Latest Update'
+	
+	item_author_name = settings.AUTHOR
+	item_author_email = settings.AUTHOR_EMAIL
+	item_author_link = settings.SITE_URL
+	
+	def items(self):
+		if memcache.get('feed_latest'):
+			posts = memcache.get('feed_latest')
+		else:
+			posts = Post.all().order('-pub_date').fetch(10)
+			memcache.set('feed_latest', posts)
+		return posts
+			
+	def item_title(self, item):
+		return item.title
+		
+	def item_description(self, item):
+		return item.trunc_body()

File posts/views.py

 from django.shortcuts import render_to_response
 from django.template import RequestContext
 from django.http import HttpResponseRedirect, Http404
+
 from django.conf import settings
 
 from google.appengine.api import memcache
 
   if request.method == 'GET':
     post = models.Post.get_by_key_name(key_name)
+    import logging
+    logging.info(post.title)
+    logging.info(post.body)
     editPostForm = postform.PostForm(initial={
                           'title': post.title,
                           'body': post.body,

File posts/views.pyc

Binary file modified.

File pygments/__init__.pyc

Binary file modified.

File pygments/util.pyc

Binary file modified.
      'context',
      'markdown',
      'pygments',
-     'gaesessions',
      'utilities',
 #    'django.contrib.auth',
 #    'django.contrib.contenttypes',
 
 
 # APP SETTINGS
+BLOG_TITLE = 'Hudarsono\'s Blog'
+SITE_URL = 'localhost'
+AUTHOR = 'Hudarsono'
+AUTHOR_EMAIL = 'hudarsono@gmail.com'
 PAGESIZE = 10

File settings.pyc

Binary file modified.

File templates/admin/newpage.html

 <div class="left-form">
 			<div class="ctrlHolder">
 				<label for="id_name" style="display:block">Name {{ pageForm.name.errors }}</label>
-				<input id="id_name" class="textInput" type="text" size="50" name="name" max_length="100"/>
+                {{ pageForm.name }}
 				<span class="inlineLabels"><p class="formHint">Max : 100 characters</p></span>
 			</div>
 			<div class="ctrlHolder">
 				<label for="id_description" style="display:block">Description {{ pageForm.description.errors }}</label>
-				<input id="id_description" class="textInput" type="text" size="50" name="description" max_length="100">
+                {{ pageForm.description }}
 				<span class="inlineLabels"><p class="formHint">(Optional) Max : 300 characters</p></span>
 			</div>
 			<div class="ctrlHolder">
 				<label for="id_body" style="display:block">Body {{ pageForm.body.errors }}</label>
-				<textarea id="id_body" name="body" cols="40" rows="18"></textarea>
+                {{ pageForm.body }}
 				<span class="inlineLabels"><p class="formHint">Use markdown to style the text.
 					<a href="http://daringfireball.net/projects/markdown/basics">Please read documentation</a></p></span>
 			</div>
 <div class="right-form">
 	<div class="ctrlHolder">
 		<label for="id_publish" style="display:block">Publish {{ pageForm.publish.errors }}</label>
-		<select id="id_publish" class=""name="publish">
-			<option value="Published">Publish Now</option>
-			<option value="Private">Private</option>
-			<option value="Draft">Draft</option>
-		</select>
+		{{ pageForm.publish }}
 	</div>
 	<div class="ctrlHolder">
 		<label for="id_navbar" style="display:block">Side Bar {{ pageForm.navbar.errors }}</label>
-		<select id="id_navbar" class=""name="navbar">
-			<option value="True">True</option>
-			<option value="False">False</option>
-		</select>
+		{{ pageForm.navbar }}
 	</div>
 	<div class="ctrlHolder">
 		<label for="id_template" style="display:block">Template {{ pageForm.template.errors }}</label>
-		<input id="id_template" class="textInput" type="text"name="template"/>
+        {{ pageForm.template }}
 		<span class="inlineLabels"><p class="formHint">Template Filename (*.html)</p></span>
 	</div>
 </div>

File templates/admin/newpost.html

 <div class="left-form">
 			<div class="ctrlHolder">
 				<label for="id_title" style="display:block">Title {{ postForm.title.errors }}</label>
-				<input id="id_title" class="textInput" type="text" size="50" name="title" max_length="100" value="{% if postForm.title.data %}{{ postForm.title.data }}{% endif %}">
-
+                {{ postForm.title }}
 				<span class="inlineLabels"><p class="formHint">Max : 100 characters</p></span>
 			</div>
 			<div class="ctrlHolder">
 				<label for="id_body" style="display:block">Body {{ postForm.body.errors }}</label>
-				<textarea id="id_body" name="body" cols="40" rows="18">{% if postForm.body.data %}{{ postForm.body.data }}{% endif %}</textarea>
+                {{ postForm.body }}
 				<span class="inlineLabels"><p class="formHint">Use markdown to style the text.
 					<a href="http://daringfireball.net/projects/markdown/basics">Please read documentation</a></p></span>
 			</div>
 <div class="right-form">
 	<div class="ctrlHolder">
 		<label for="id_category" style="display:block">Category {{ postForm.category.errors }}</label>
-		<input id="id_category" class="textInput" type="text" size="50" name="category" max_length="30"  value="{% if postForm.category.data %}{{ postForm.category.data }}{% endif %}">
-		<span class="inlineLabels"><p class="formHint">Word or Phrase</p></span>
+        {{ postForm.category }}
+   		<span class="inlineLabels"><p class="formHint">Word or Phrase</p></span>
 	</div>
 	<div class="ctrlHolder">
 		<label for="id_tags" style="display:block">Tags {{ postForm.tags.errors }}</label>
-		<input id="id_tags" class="textInput" type="text" size="50" name="tags"  value="{% if postForm.tags.data %}{{ postForm.tags.data }}{% endif %}">
+        {{ postForm.tags }}
 		<span class="inlineLabels"><p class="formHint">Separate by space</p></span>
 	</div>
 </div>

File templates/feeds/latest_description.html

+{% autoescape off %}
+{{ obj.trunc_body }}
+{% endautoescape %}

File templates/feeds/latest_title.html

+{{ obj.title }}
 
 from django.conf.urls.defaults import *
 from django.conf import settings
+from posts.rss import LatestFeed
+
 
 urlpatterns = patterns('',
     # Example:
 	(r'^media/upload/', 'media.views.upload'),
     (r'^media/download/([-\w]+)', 'media.views.download'),
 
+	(r'^feeds/latest/$', LatestFeed()),
 
     (r'^contact/$', 'pages.views.contact'),
     (r'^([-\w]+)', 'pages.views.render'),

File urls.pyc

Binary file modified.