{"id":188,"date":"2006-12-15T18:56:41","date_gmt":"2006-12-15T18:56:41","guid":{"rendered":""},"modified":"2006-12-15T18:56:41","modified_gmt":"2006-12-15T18:56:41","slug":"updates_on_django_cms_s_and_church_websi","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/seemant\/2006\/12\/15\/updates_on_django_cms_s_and_church_websi\/","title":{"rendered":"Updates on Django, CMS&#8217;s and Church websites"},"content":{"rendered":"<p>In still other news, I&#8217;ve been playing with django&#8217;s <a href=\"http:\/\/www.djangoproject.com\/documentation\/newforms\/\">newforms<\/a> module for creating forms on the websites I&#8217;ve got in the pipeline.  It looks like <a href=\"http:\/\/www.streambase.com\/\">the StreamBase website<\/a> will finally be content-managed, though not by django, but by something else.  I&#8217;m hard at work on getting the website for Aimee going.  This weekend will be a <a href=\"http:\/\/www.reportlab.org\">ReaportLab<\/a> weekend for me.  There are some documents on the church site that will be in both web-readable and PDF-able form.  I have this notion that I can do both, though I admit to that being somewhat hopeful.  We&#8217;ll see.<\/p>\n<p>Before I even do that, I have to do major cleanup on the code already written.  It&#8217;s funny to see how my knowledge of Django has evolved in the last few months.  I&#8217;m going back in, currently, to do some DRY&#8217;ing of a lot of the stuff in there &#8212; gosh I repeated myself!  But it was intentional, just to get functionality going &#8212; I knew I&#8217;d go back in and clean up.  And here I am on the other side of that.  I&#8217;m not complaining at all, mind you, because I feel like I&#8217;ve learned a lot when I look at that old code.<\/p>\n<p>I&#8217;ll share one of the long-standing issues I&#8217;m having.  The church has a calendars page which shows upcoming and past weekly schedules.  Being a church, they have services every Sunday.  During the week and in other rooms\/halls they have other meetings (Rotary Club, etc).  So, the calendars page needs to show all of those.  I opted for this approach in the end: a BaseEvent which holds the date, the title and slug information and description field.  The Event object has a one-to-one relationship, and it has fields for frequency and timetables (Timetables are a separate model, so they&#8217;re foreign-keyed into the Event).  The Service object holds the information on the priest, the crucifers, foreign key to the Sermons, etc, and it also has a foreign keys to the Timetable. If there&#8217;s enough interest, I&#8217;ll put up that file for you all to see and critique.  I definitely have not gotten it right, so I&#8217;m glad of any input.<\/p>\n<p>So the idea is that a request to the \/events\/ URL shows the archive of most recent and immediately upcoming events and services.  The same with \/events\/yyyy, \/events\/yyyy\/mmm\/ and \/events\/yyyy\/mmm\/dd.  So the query dictionary has to include all of them, reversed-ordered by date.  A request to the \/services\/ URL is obviously a filtered query, and the like.  Now, when you click on a specific event, it either goes to \/events\/yyyy\/mmm\/dd\/event-name or to \/services\/yyyy\/mmm\/dd\/service-name.  That&#8217;s the motivation for all this.  If there&#8217;s a better way you can think of, please drop me a comment.  I&#8217;m definitely interested in the opinions of you ruby and rubyonrails people.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In still other news, I&#8217;ve been playing with django&#8217;s newforms module for creating forms on the websites I&#8217;ve got in the pipeline. It looks like the StreamBase website will finally be content-managed, though not by django, but by something else. I&#8217;m hard at work on getting the website for Aimee going. This weekend will be &hellip; <a href=\"https:\/\/blogs.gentoo.org\/seemant\/2006\/12\/15\/updates_on_django_cms_s_and_church_websi\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Updates on Django, CMS&#8217;s and Church websites<\/span><\/a><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/seemant\/wp-json\/wp\/v2\/posts\/188"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/seemant\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/seemant\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/seemant\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/seemant\/wp-json\/wp\/v2\/comments?post=188"}],"version-history":[{"count":0,"href":"https:\/\/blogs.gentoo.org\/seemant\/wp-json\/wp\/v2\/posts\/188\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/seemant\/wp-json\/wp\/v2\/media?parent=188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/seemant\/wp-json\/wp\/v2\/categories?post=188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/seemant\/wp-json\/wp\/v2\/tags?post=188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}