paster shell - do people know about it?

January 21, 2010 at 07:22 AM | categories: sqlalchemy, pylons | View Comments

Today I was having a chat today about Pylons vs. Django and for the most part it was pretty diplomatic. We got to talking about the Admin interface the Django has. Which you don't have to do any extra boiler plate for, it is just there for you. With Pylons you have to use something like FormAlchemy or use Turbogears to get a similar style admin interface for your models and data. Since we were sitting at a computer, I went ahead brought up a quick project and did a little demo of the paster shell. Sure, it involves typing and it isn't as pretty or "fast" as an admin panel, but he didn't even know it existed. One of the common things he mentioned was, "if I want to change the menus that are dynamically defined" or "if a username needs to be changed" .. and the application itself doesn't have a custom admin panel, with Pylons he had to do raw SQL.

$paster shell pylons_config.ini

All objects from demo.lib.base are available
Additional Objects:
   mapper     -  Routes mapper object
   wsgiapp    -  This project's WSGI App instance
   app        -  paste.fixture wrapped around wsgiapp

>>> error_user = meta.Session.query(model.User).filter_by(username='wwitzel 3').one()
>>> # nice thing about this, is you also will get exceptions throw if more than one record exists
>>> error_user.username
u'wwitzel 3'
>>> error_user.username = 'wwitzel3'
>>> meta.Session.commit()
>>> menu_typo = meta.Session.query(model.Menu).filter_by(id=1).one()
>>> menu_typo.value
u'Abuot'
>>> menu_typo.value = 'About'
>>> meta.Session.commit()
So that is a very simple example of how one would use the paster shell to update some bad data in the database while ensuring integrity of your custom model and extension code. After I showed this to my friend he wasn't as concerned about the lack of a web interface for administration within Pylons.

Read and Post Comments

What I Look For In A Job

January 20, 2010 at 05:13 AM | categories: personal | View Comments

So I'm currently looking for new work and I've defined my list of items that are high priority to me. I figured I'd list them here and then break each down in to a little detail. Mainly because I'm up late at a stopping point in some code and haven't updated my blog in forever.

  • Refreshing
  • Excitement
  • Vision
  • Caring
Refreshing What do I mean by refreshing? I mean a company that isn't doing what everyone else. Something that isn't YAIC (Yet Another Internet Company). For me, this can really mean two things though. It could also mean a company that produces software for an industry I've never worked in before, but ideally it is a company doing something new, innovative, and refreshing. At the end of the day, writing software for them makes you go "Ahhhhhhhhhh". Excitement I want everyone in the company I am working for to be jacked about working there. I want people to be excited about the products. Even if they are boring everyday products. If everyone there is excited about them and cares about them it promotes a much better work environment and in my experience a higher quality product. Vision Here's where we are. Here's where we are going. Here is how WE are gonna do it. This seems as one of those things that is so easily over looked once you're out of lets keep this startup from dying working 100 hours a week mode, but even for established companies this is so important. Without a vision your company will eventually end up stuck in the mud. Caring This is more in the human respect. We are sometimes at work more than we are at home. This is especially the case with small companies and start-ups (and even some big ones). Companies that care, have employees that care. Treating employees like cattle will only result in employees treating the company like a feed station. Every place I've worked that did mandatory start / end times or mandatory OT always had issues getting coverage and had huge turn over rates compared to flex time locations with resources for employees to relax, take breaks, and feel cared about.

Read and Post Comments