Commits

Sai Krishna K  committed d56be46

added custom title

  • Participants
  • Parent commits f729a42

Comments (0)

Files changed (5)

File index/admin.py

 	form = about_adminForm
 
 #admin.site.register(blog,blog_modaladmin)
-admin.site.register(about,about_Admin)
+admin.site.register(about,about_Admin)
+admin.site.register(title)

File index/models.py

 	about_data=models.TextField(blank=True)
 	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

             <span class="icon-bar"></span>
           </a>
           <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>
           </a>
           <div class="nav-collapse">
             <ul class="nav">
 <div class="container" id="page_footer" style="">
 		<hr/>
         <footer>
-        <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>Using</li>
               <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

+# this_about = about_model.objects.all()[0]
+
+from django import template
+from index.models import title as title_model
+
+register = template.Library()
+
+@register.filter
+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()