Archive for the ‘SqlAlchemy’ Category

Filed Under (Mercurial, Pylons, SqlAlchemy, Threads) by Marcin Kuźmiński on June-1-2010

Since, me and Lukasz fine tuned the vcs library i manage to setup a beta version of hg app. I was tired of the boring looks, and poor source code browsing capabilities of the hgwebdir.
So i started to write my own app, at the beginning it was just a simple hgwebdir wrapper, to pylons, now it’s fully standalone replacement. Including abilities to push/pull thrum the application.

Pylons based replacement for hgwebdir. Fully customizable,
with authentication, permissions. Based on vcs library.

  • has it’s own middleware to handle mercurial protocol request each request can
    be logged and authenticated +threaded performance unlikely to hgweb. Middleware recognises a mercurial protocol
    and skips any functionality for pure web request
  • mimics full functionality of hgwebdir including feeds,archives,diffs,raw-diffs,annotations,file history etc.
  • mako templates let’s you customize look and feel of the application.
    Possibly visual merge with your company systems
  • diffs annotations and source code all colored by pygments (see screenshots).
  • admin interface for performing user/permission managements as well as repository
    managements. Out of beta version should have fully customizable permission system, with
    private repos, and repo permissions
  • added cache with invalidation on push/repo managment for high performance and
    always upto date data.
  • rss / atom feeds
  • future support for git (thanks to vcs mercurial/git api should be 1:1
  • based on pylons 1.0 / sqlalchemy 0.6 /sqlite(possibly mysql/postgres thanks to sqlalchemy models)

Below are the beta version screenshots. Now I’m not good at designing webapps, so excuse me if you feel the look&feel to be to simple or bad looking.
It’s all i could come up with. Most of my expiration was taken from hgwebdir/bitbucket and github. I tried to take all best parts from all of them and combine into this app.
It’s still in beta but i think it’s production ready in this stage I’m using it for few weeks, and had no troubles or crashes with it. The code can be grabbed at bitbucket repo http://bitbucket.org/marcinkuzminski/hg-app/



Filed Under (SqlAlchemy) by Marcin Kuźmiński on April-22-2010

Few days ago there’s been a mayor release of SqlAlchemy.
There are a lot of bugfixes new features in tis release, but four things
are worth mentioning in this major release. Beaker caching for Query.
- RETURNING Support on insert, update and delete – might come in very handy.
- Pickable query result. Means sqlAlchemy objects could be kept in sessions (did not check that)

After some checks i decided to move my projects to the new version, since i did that i needed to
update my model generator for SqlAlchemy it’s been rewritten for sqlalchemy 0.6
and now works with 0.5 and 0.6 versions. Additionally i made some small fixes i found. Any feedback is welcomed.



Filed Under (Python, SqlAlchemy) by Marcin Kuźmiński on February-9-2010

I’m in a way of releasing few of my projects to bitbucket.
Starting now I’m releasing the Sqlalchemy model generator. A quick reminder, it’s a project that you
can generate models based on your database. So you don’t need to write models by yourself.
You can see the project here: http://bitbucket.org/marcinkuzminski/sqlalchemy_model_generator/
Any participants are welcomed.



Filed Under (Django, Pylons, SqlAlchemy) by Marcin Kuźmiński on September-26-2009

Recently i had to create a lot of models using declarative mode with sqlalchemy 0.5.5 It was very time consuming especially for large databases. I started to think about an automated solution.

Sqlalchemy have this auto load feature which fetches info about tables by itself. I wanted to use this somehow to generate a string which can be easily  copy/paste to database model definition script. So i started a little project to write auto  model generator for sql alchemy based on auto load feature in sqlalchemy.

The script  is not perfect but it works and save a huge amount of time just codding the models. In fact is was able to setup a 186 table database model in 15minutes with this script.

Well the script helped me a lot and now on when i have to load some new existing database or changes i use it all the time.

The documentation is inside the script i tried to write it so anybody could use it out of the box.

I tested it on 4 schema 200+ tables database and i worked quite good. This script still have to be polished but current functionality is enough for most users.

My script is going to be also a part of django-alchemy project started by my friend Lukasz Balcerzak. You can visit the project site @ http://code.google.com/p/django-alchemy/

I used it with Pylons application and Django with modded sqlalchemy. but it can be basically used in any app which uses sqlalchemy. I did not test it with mysql though,but it should work, just specify mysql as dialect.

You can download this script from sqlalchemy model generator



Filed Under (Django, SqlAlchemy) by Marcin Kuźmiński on September-5-2009

One of my friends started an interesting project to integrate sqlalchemy into Django. Project name is django-alchemy.
You can visit it on Google code under http://code.google.com/p/django-alchemy/.

You may ask why to use sqlalchemy under Django if it already have an ORM ?
It’s very easy the django orm is not always the best choice. When using multiple schemas, or multiple database connection the Django ORM just does not provide such functionality.
SqlAlchemy have this built in so when you’re thinking of using multiple schemas or databases in your django project check out his project. Highly recommended