Monday, December 29, 2008

BootIt NG from TeraByte Unlimited

I'm thinking of buying BootIt NG from TeraByte Unlimited to solve backup/boot/partitioning stuff in the household. With the hard drive failure on a significant other's computer, I've been thinking quite a bit about this and I'd like to do something about it before it hurts.

Monday, December 22, 2008

Python & SOAP

Generally speaking, python doesn't work well with SOAP services out there. I went through a bunch of tutorials, blog posts and massive Google-ing and found very little that worked. I have a M$ created SOAP service that I need to work with and it was just a pain.

I tried SOAPpy and ZSI and neither worked well. This left me with two options. Either I could work in the XML and use urllib to post the info, and consequently parse the results or I could use the PHP example. Both of these are gross. I ended up choosing the PHP idea. I put a php script in my Django app and called it (sending along the appropriate parameters) with from my Django view. It worked but man does this solution suck. I don't have appropriate error handling and there's the future compatibility issue. Yikes.

Anyway, I just kept my ear to the ground on this while my app was doing its thing. Until I read in a Google Group about the best answer for SOAP and Python. It's Suds (https://fedorahosted.org/suds/). Very easy to use, works perfectly and now it's python instead of PHP. My error handling works and I can feel a lot more comforatable about this app into the future.

If you're working with Python or Django and you need to consume a SOAP web service, do yourself a favor and get Suds. It's worth re-writing your old code.

Thursday, November 20, 2008

think i'll go sit by the river just to get outside of my mind. i'm wishing i could stay here forever but the river won't stay that long, it's moving on. ~Chad VanGaalen

Friday, October 10, 2008

US Financial Crisis

As a Canadian, I'm being told (promised) by the federal politicians that our nation isn't going to be as affected by the US financial crisis as it would seem. Since we get US television, we're bombarded with news so it's hard to not get scared.

However, here's a link to help understand things. Very funny. Some course language.

Thursday, July 24, 2008

Django Newforms Admin learning

Not the easiest but perhaps the best way to add on to the User in django.contrib.auth:

In one of your other models, create the mixin code. This adds these fields to your application's version of the User.


from django.contrib.auth.models import User
User.add_to_class("company", models.ForeignKey(Company, blank=True, null=True))
User.add_to_class("title", models.CharField(max_length=100, blank=True))
User.add_to_class("company_admin", models.BooleanField(default=False))


Of course, you'll need to add the fields to the database manually.

Now, to add them to the admin. The following code takes the Newforms Admin's version of the UserAdmin and adds some extra stuff.


from django.contrib.auth.admin import UserAdmin
UserAdmin.list_display += ('company','title','company_admin')
UserAdmin.list_filter += ('company_admin')
UserAdmin.fieldsets += (
('Company Info', {'fields': ('company', 'title', 'company_admin')}),
)


By using Mixin's without a lot of code, you can add to User model and still use the exact same shortcuts and decorators (get_profile() still works.)

Inspiration came from http://www.amitu.com/blog/2007/july/django-extending-user-model/ and some extra work to get it to work with Newforms Admin.

Wednesday, May 14, 2008

Realization

Thursday, April 24, 2008

50 ways