Florida DrupalCamp 2010

This last Saturday (Feb 20th) I had the privilege of attending Florida DrupalCamp 2010. It was a great time and very much a worthwhile investment of time. There were great presenters, presentations and good food as well as swag. I don’t think one could ask for more for $6.11. The lunch or t-shirt alone were worth more than that. In fact I joked with my friends that when I was younger and single I’d have signed up for it just to get the food, even if I didn’t know what Drupal was.

This was my second DupalCamp after attending the camp in Atlanta last year. This one was smaller, but I think that makes sense, as the population of the Atlanta metro area is more than double that of the Orlando area. That said, the turnout was solid. The space was limited and it didn’t take long for all the spots to be taken and a waiting list to form. The event was held at the offices of Mindcomet, and they were very nice. It was a bit tight for all the people that came to the camp, but I was impressed they could handle all of us. They had very functional spaces and I thought more that once it looked like it would be a really nice place to work.

If you hit the camp site you can see what the schedule looked like and what sessions were offered. I mostly stuck to the intermediate track, and tried to upgrade my understanding of CCK, Views and taxonomy. As in Atlanta, I spent a lot of time just jotting down information of the various modules that presenters were using and storing that away for future reference. So much of the power of Drupal lies in learning what modules offer the most bang for the buck. I think I’ll start writing up posts on specific modules here in the near future. This is one space that seems to be lacking good resources. I hit “Top 10” lists every so often, but not much of real substance.

After the session on writing modules I bailed from the theming side of the intermediate track and jumped in to the beginner track for the sessions on modules and site maintenance. I don’t mind knowing how theming works, but I also know that design is not one of my strengths. If that kind of thing really matters, then the smart thing for me to do is not to spend tons of time and effort on what will be a mediocre outcome at best. I’m better off getting help from someone gifted and skilled in visual design. I can focus on my strengths that way and make sure things work the way they should while they make it all look nice.

I couldn’t attend the second day, it being my son’s birthday and life upset I’d taken an extra day away as it was. The folks that went got together and built a site for a local non-profit. They teamed up experienced folks with new folks and it was an opportunity to invest in the community and learn at the same time. Pretty awesome I think.

The sessions were videotaped and I’ll post when they become available, as anyone who couldn’t make it can still get the information. Everybody involved in putting this on did a phenomenal job. I was very impressed and I’m looking forward to next year.

XX

How did we make it back in the day when you couldn’t hear some music in the background of a commercial, google it, and be listening to the song a few seconds after you saw the commercial? Did I really sit up at night, thumb literally on the record button of my cassette deck waiting for a song I wanted to come on the radio? I’m pretty sure I did but that seems like something I’d laugh at in a movie, not something I actually did.


Python, UnixODBC, MDBTools and Microsoft Access on Fedora 12

This is funny to me in light of my last post. I have installed UnixODBC, I installed the gui tool to manage it and then I installed MDBTools to allow me to connect to a JET database. (This is all on my Fedora 12 machine by the way for those just joining us.) The funny part is that the time I spent getting the gui tool was wasted as it wont work with the driver anyway, at least not the way I’ve set it up. Not sure why, not sure that I care. Here is what I did to get it to work. First I checked for the driver ( /usr/lib/libmdbodbc.so.0 in my case ). It was there so I edited /etc/odbcinst.ini and added the following entry.

[MDBToolsODBC]
Description = MDB Tools ODBC
Driver = /usr/lib/libmdbodbc.so.0
Setup =
FileUsage =
CPTimeout =
CPReuse =



That takes care of telling UnixODBC about the driver. I wonder if there is a file from MDBTools that I can use for the setup part. Not sure, may look into it at some point. The next step was creating a DSN. That involved adding the following lines to /etc/odbc.ini (Which existed but was empty because I hadn’t created any entries yet.)

[lintry]
Description = Microsoft Access Try DB
Driver = MDBToolsODBC
Database = /home/jr.peck/Documents/lintry.mdb
Servername = localhost
Username =
Password =
port = 5432




Here is what a connection in Python could look like.

import pyodbc


sql = 'Select * from foo'

conn = pyodbc.connect('DSN=lintry')
cursor = conn.cursor()
cursor.execute(sql)
rows = cursor.fetchall()

for record in rows:
    print record.FirstName + ' ' + record.LastName
  
cursor.close()
conn.close()



In my database the table foo contains three columns and the first two are FirstName and LastName. So anyone messing this will obviously need to change it to match their table name, column names, etc. This last piece of getting things to work on Linux wasn’t really necessary but it didn’t take all that long to figure out and I’m glad I did, in case I do need it down the road. I imagine this would work just the same for any other programming language that could take advantage of UnixODBC.

Fedora and UnixODBC

January of last year UnixODBC spun off non-core code to separate projects of their own. The reasoning they give on their site makes sense. I’m just not sure I follow all the ramifications when it comes to how this works out on the user level with different distros. What I do know is that with Fedora if one wants to use the gui ODBC manager, ODBCConfig, then that does not come in the unixODBC package – it comes in unixODBC-kde. What’s interesting is that over at their sourceforge file list it shows a GTK version but that doesn’t show up in my KPackageKit list. I’m not sure how that came to be and I’m not sure if I have time or the inclination to figure it out.

The thing that drives me to mention it at all is that if one is googling around looking for info. on how to use UnixODBC, they are going to come under the impression that ODBCConfig is part of that package. The reason I figured out to look for something else was I happened to google Fedora and UnixODBC and ran across a forum posting that put me on track.

Looking at the ODBCConfig page itself, with a last update over 10 years ago, I wonder if those goes back further than last year. I don’t know. I haven’t messed with UnixODBC in quite a while and last time I did it was on AIX and I was just concerned with MS SQL Server drivers. Now I’m trying to get my little Python program I wrote to read an MS Access database running on my Fedora machine. This is stupid in a sense as I’d never willingly use MS Access on a linux box but I just want to see if I can do it. It would make more sense to switch to SQLite.

So just to sum up – if you want to use UnixODBC on Fedora, with the gui admin tool, you need to install 2 packages rather than just one. Getting the drivers themselves is also another matter. My next task is to see if I can MDBTools and UnixODBC to play nice together. I’ve found examples from folks who say they’ve done it so I’m going to give it a whirl.

Building A Model for a QTreeView

On my little PyQt email program I wanted to be able to generate a list of who would get the emails. I wanted to see this before I actually sent them. I wanted a name and an email to go with it. This means getting the data into a model and then having the view widget load the model. It took me forever to figure out how to do this, as I’m a bit slow. But now that it is done, I’d better document it a bit because I’ll forget and need to do it again later.

Here’s what actually building the model and loading it looks like:

def mpreview(self):
        query = 'Select Greeting, User2 from Contact where len(User2) > 3 order by Greeting'
        dbase=r'C:\Documents and Settings\JR Peck\My Documents\mpd_stuff\linkedtnt.mdb'
        newdata = mpddata.MpdData(query, dbase)

        total = len(newdata.rows)
        row=0
        model = QtGui.QStandardItemModel(total,2)
        
        model.setHorizontalHeaderItem(0,QtGui.QStandardItem('Greeting'))
        model.setHorizontalHeaderItem(1,QtGui.QStandardItem('Email'))
        
        for record in newdata.rows:
                model.setItem(row,0,QtGui.QStandardItem(record.Greeting))
                model.setItem(row,1,QtGui.QStandardItem(record.User2))
                row = row + 1
                
        self.ui.tblRecip.setModel(model)

The reference for QTableView was helpful. It just took me a while to understand what it would take to build a QStandardItemModel. Once I got that figured out, then it was easy.

Arjuna-X

The new theme is Arjuna-X. I like it, and look forward to messing with it. It comes with quite a few nice config options right out of the box, so I feel comfortable just throwing it on now and messing with it once I have some time to do so. Next post should include some code to see how that comes out.