Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #16018

sqlalchemy beginner

From Jabba Laci <jabba.laci@gmail.com>
Date 2011-11-21 16:56 +0100
Subject sqlalchemy beginner
Newsgroups comp.lang.python
Message-ID <mailman.2906.1321891043.27778.python-list@python.org> (permalink)

Show all headers | View raw


Hi,

I'm reading the Essential SQLAlchemy book from O'Reilly. It explains
SqlAlch 0.4 but my current version is 0.7 and there are some
differences.

Here is an example from the book:

user_table = Table('tf_user', metadata,
        Column('id', Integer, primary_key=True),
        Column('user_name', Unicode(16), unique=True, nullable=False),
        Column('password', Unicode(40), nullable=False),
        Column('display_name', Unicode(255), default=''),
        Column('created', DateTime, default=datetime.now)
    )

Here I get the following warning:

SAWarning: Unicode column received non-unicode default value.
  Column('display_name', Unicode(255), default=''),

Changing Unicode(255) to String(255) makes the warning disappear but
I'm not sure if it's the correct solution.

For table names, the book uses the prefix convention 'tf_' but what
does it mean? 't' is table, but what is 'f'?

Thanks,

Laszlo

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

sqlalchemy beginner Jabba Laci <jabba.laci@gmail.com> - 2011-11-21 16:56 +0100
  Re: sqlalchemy beginner John Gordon <gordon@panix.com> - 2011-11-21 17:08 +0000
  Re: sqlalchemy beginner Roy Smith <roy@panix.com> - 2011-11-21 19:25 -0500
    Re: sqlalchemy beginner alex23 <wuwei23@gmail.com> - 2011-11-21 18:51 -0800
      Re: sqlalchemy beginner Roy Smith <roy@panix.com> - 2011-11-21 22:18 -0500
        Re: sqlalchemy beginner Cameron Simpson <cs@zip.com.au> - 2011-11-22 17:06 +1100

csiph-web