1. Sai Krishna K
  2. simple_blog


Sai Krishna K  committed d56be46

added custom title

  • Participants
  • Parent commits f729a42
  • Branches master

Comments (0)

Files changed (5)

File index/admin.py

View file
 	form = about_adminForm

File index/models.py

View file
 	def __unicode__(self):
 		return 'there can only be on item here edit the same thing :P'
+class title(models.Model):
+	blog_title = models.CharField(max_length=50)
+	def __unicode__(self):
+		return 'there can only be on item here edit the same thing :P'

File index/templates/base_page.html

View file
             <span class="icon-bar"></span>
           <a class="brand" href="#">
-          	<a class="brand" href="/">w4rlock's blog</a>
+          	<a class="brand" href="/">{% load get_title %}{{'x'|get_title}}'s blog</a>
           <div class="nav-collapse">
             <ul class="nav">
 <div class="container" id="page_footer" style="">
-        <p style="color: black">w4rlock's blog</p>
+        <p style="color: black">{% load get_title %}{{'x'|get_title}}'s blog</p>
          <ul id="technologies">
               <li><a href="http://www.djangoproject.com/">Django 1.4</a></li>

File index/templatetags/__init__.py

Empty file added.

File index/templatetags/get_title.py

View file
+# this_about = about_model.objects.all()[0]
+from django import template
+from index.models import title as title_model
+register = template.Library()
+def get_title(parser):
+	try:
+		title = title_model.objects.all()[0]
+		this_title = title.blog_title
+	except Exception, e:
+		this_title='No title'
+	return this_title
+# @register.filter
+# def upcomming_count(parser):
+# 	movies_in_theater=movie_theater_status.objects.filter(release_status='D')
+# 	return movies_in_theater.count()