Am 05.05.2016 um 12:03 schrieb D'Arcy J.M. Cain:
> It does occur to me now that doing this only makes sense if you are
> also creating specialized methods for managing the data so I guess it
> doesn't hurt if I keep doing it in my own subclasses.  There's no real
> benefit to doing this in a raw database connection other than saving a
> few keystrokes here and there.

Creating such subclasses for the various tables could be an interesting usage pattern. You could set a _table class attribute for the respective table, then you don't even need to pass it to select:

  def select(self, table=None, data=None):
    if not table: table = self._table
    if not data: data = self
    # ... get row and merge into _data
    return data

Using PyGres that way would feel a bit like using an ORM.

-- Chris
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql

Reply via email to