ANN: PyDAO - Python Hibernate-like Object-Relational Mapper

C

cieslak.dariusz

PyDAO is very thin object-relational mapper similar to Hibernate (but
much simpler). It's created to speed-up application development. It's
very simple, but powerful, based on POPO (Plain Old Python Objects).

http://aplikacja.info/PyDAO.html

Main features:

- can use any database that has DB-API interface (MySQLdb, psycopg
tested)
- can work without database at all (useful for early phases of
development)
- speeds up unit testing (dedicated in memory database)

What is not handled:

- automatic scheme generation
- separate query language
- automated handling of associations (replaced by filtering by
foreign keys)

Here's an example how to use PyDAO:

class User:
def __init__(self):
self.id = None
self.login = None
self.password = None

dao = pydao.InMemoryDao()

# filling database
user = User()
user.login = "user1"
user.password = "roh8OoPh"
dao.save(user)

# filtering based on example
userSearch = User()
userSearch.login = "user1"
userList = dao.list(userSearch)

# updating
user.password = "eew8Me8g"
dao.update(user)

Enjoy!
 
?

=?iso-8859-1?q?Luis_M=2E_Gonz=E1lez?=

PyDAO is very thin object-relational mapper similar to Hibernate (but
much simpler). It's created to speed-up application development. It's
very simple, but powerful, based on POPO (Plain Old Python Objects).

http://aplikacja.info/PyDAO.html

Main features:

- can use any database that has DB-API interface (MySQLdb, psycopg
tested)
- can work without database at all (useful for early phases of
development)
- speeds up unit testing (dedicated in memory database)

What is not handled:

- automatic scheme generation
- separate query language
- automated handling of associations (replaced by filtering by
foreign keys)

Here's an example how to use PyDAO:

class User:
def __init__(self):
self.id = None
self.login = None
self.password = None

dao = pydao.InMemoryDao()

# filling database
user = User()
user.login = "user1"
user.password = "roh8OoPh"
dao.save(user)

# filtering based on example
userSearch = User()
userSearch.login = "user1"
userList = dao.list(userSearch)

# updating
user.password = "eew8Me8g"
dao.update(user)

Enjoy!


Interesting, but The link to AbstractDaoTest.py gives me an error
message...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top