Conversations With Myself
Tuesday, March 28, 2006
  Python: Turbogears and Templates
Been working one of the pages and setting up conditional stuff in a table. Seems to working well. Basically if I return data with some rows in it I display a select dropdown if not I display a submit button that will allow the user to create whatever it is they don't have to select from...

I wonder if that made sense.

Basically it does something like this:

are there rows?

if yes:
show the rows

if no:
show a button that takes you to a page
so you can create the type of things
you don't have rows for.

 
Tuesday, March 14, 2006
  Python: Templates in TurboGears, and a solution to SQLObject Problem
Well, I got templates working, and it was not as bad as it could have been. Plus I found an example of looping through a SQLObject and it is rather elegant. Although I have not implemented. I should be able to do something like this:


for Table.field in Table.select(Table.q.select(fred=1)):
do something here.


Once I get the real code working I will post it.

Templates are fun, but at times frustrating, plus I think I was trying to do something you can't easily do, nested for loops in a template. Just didn't work, so I went a different way. So my homepage for my project is about 30% complete, it is taking me a little longer than I would like, but then that is what happens when you are learning something for the first time.

Plus I found some idiosyncrasies with extended templates not being picked up without a restart of the CherryPy Server, but that made sense to me for some reason. I figure it grabs the master.kid which is being extended when it starts and does not check to see if it has changed and needs to be reloaded.

I do like the fact that CherryPy know when the controllers.py or model.py file is saved, that might be TurboGears doing that, but it is cool you change the page save it and the server shuts down and restarts.

So all in all I nice system. Oh also, yesterday I upgraded to TurboGears 0.9 to get all the new features, of course there is very little documentation on these features so I have not had a chance to explore them.

But it was fun working on it when I wasn't in meanings and doing real work. Although I just have to convince my boss that real company projects can be developed in this language.

Java, not my favorite language is what I am working in for the current project. In fact once I finish the authentication pages that I am working on, I will look into implementing our new front-end with JSFaces, looks sort of .NET like, and I enjoyed that once I learned it so we will see how that goes over the next few weeks. So I should have more side by side compares and experiences to relate in the near future.
 
Monday, March 13, 2006
  Python: SQLObject or How Dumb a Programmer am I?
Ok, I know that I am dumb sometimes, but I also must be really thick too. It took me most of the day to figure out how to do a simple select query in SQLObject.

Basically I ended up doing something like this:



def VoiceTypeContents(self):
p = VoiceType.select().count()
html = "<li>" + str(p)
if p > 0:
for i in range(p):
vt = VoiceType.get(i + 1)
html += "<li>" + vt.description
return html



Now I am sure there is a better way, but the biggest complaint that I have with programmers and I am one of them, is that we suck a doing documentation. And since a lot of open source stuff is early in its development cycles, examples are quite sparse.

Now that being said, I think that SQLObject is a great package, and I can see the power of it and I am sure as I figure it out it will be fun to work with, but boy did I pound my head against some walls today.

Next is doing the same thing as above but using templates. :) Dumb stuff I know, but it is how we learn.
 
Friday, March 10, 2006
  Python: Church Music Assistant v0.01
One thing that I have not really talked about here is my professional life, I am a programmer by trade, currently writing things in VB6, Java and Python. I picked up Python about a little over a year ago, when I got hired in my current job.

Well one of things that I started working on in my spare time was something to keep the Church Music that I select such as hymns and anthems organized.

My first attempt was to do a tradional application in Windows using python and wax a wxPython wrapper. Well I didn't get very far, basically because I got swamped at work.

Well recently I have been exposed to TurboGears, and I bit the bullet and have upgraded my Python to 2.4, so now I am all set to recode my app in Turbogears.

My plan is that this will become the start of progamming diary, about the trials and tribulations of creating a Web Application from scratch with a totally new framework. I have done this professionally in .NET and in a language nobody probably has heard of MetaHTML, but I have not done it recently so it will not necessarily be a new experience, but I am sure it will be an interesting one.

I will keep you all posted.
 
Monday, March 06, 2006
  What Kind Of SpaceShip Am I
You scored as Serenity (Firefly). You like to live your own way and don�t enjoy when anyone but a friend tries to tell you should do different. Now if only the Reavers would quit trying to skin you.

Serenity (Firefly)

100%

Deep Space Nine (Star Trek)

94%

Babylon 5 (Babylon 5)

94%

Nebuchadnezzar (The Matrix)

94%

SG-1 (Stargate)

81%

Bebop (Cowboy Bebop)

75%

Enterprise D (Star Trek)

75%

Millennium Falcon (Star Wars)

75%

Moya (Farscape)

75%

FBI's X-Files Division (The X-Files)

56%

Andromeda Ascendant (Andromeda)

50%

Galactica (Battlestar: Galactica)

50%

Your Ultimate Sci-Fi Profile II: which sci-fi crew would you best fit in? (pics)
created with QuizFarm.com
 
Here you will find what I find interesting to comment on. What interests me is Music, especially Church Music. Photography, Programming, Golf, and Politics.

Name:
Location: Thorndale, Pennsylvania, United States

I have been married for almost 23 years, and am the father of a teenage girl. I spend my days programming in just about any language they want in the banking and investing field. In the evening I work on my music, currently concentrating on arrangements and new choral pieces for my Church Choir. I have been Minister of Music, at my church for the past year, looking forward to next year. When I have time, I take pictures of anything and anyone. Also I play golf, not very well, but I enjoy it. Finally what I enjoy most is spending time with my family.

Blogs I Read

ARCHIVES
June 2005 / July 2005 / August 2005 / September 2005 / November 2005 / December 2005 / January 2006 / March 2006 / April 2006 / May 2006 / January 2007 /


Terror Alert Level

Powered by Blogger