paster shell - do people know about it?
January 21, 2010 at 07:22 AM | categories: sqlalchemy, pylons | View CommentsToday 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.
What I Look For In A Job
January 20, 2010 at 05:13 AM | categories: personal | View CommentsSo 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