Hello,
I am using sqlalchemy with pylons. I write audit log messages to table.
I use the orm to map my table to my class.
orm.mapper(AuditTable, audit_table)
self.engine = create_engine(connect_string)
metadata.bind = self.engine
metadata.create_all()
OK,
after some more reading and thinking, I think i managed it this way:
self.session.add(at)
self.session.flush()
# At this point at contains the primary key id
at.signature = self._sign( at )
self.session.merge(at)
self.session.commit()
Kind
I have a composite Primary key in a table and a relative Foreign Key
in another as:
sensors = Table('sensors', metadata,
Column('id_cu', Integer, ForeignKey('ctrl_units.id',
ondelete='CASCADE'),
primary_key=True, autoincrement=False),
Column('id_meas', Integer,
This is my first post here, I've been learning about the query api and I've
got three related questions:
1. Suppose I have a User model and UserThing which is loaded into the
User.things collection, UserThing is polymorphic via joined table
inheritance. I'd like to do something like this:
2011/5/30 Cornelius Kölbel cornelius.koel...@lsexperts.de
OK,
after some more reading and thinking, I think i managed it this way:
self.session.add(at)
self.session.flush()
# At this point at contains the primary key id
at.signature = self._sign( at )
It's not clear from your code, but are you using InnoDB or MyISAM? You need
to be using InnoDB for foreign keys to work properly.
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To
You need to use InnoDB engine, so you tables definitions 'll look
like:
sensors = Table('sensors', metadata,
...
mysql_engine='InnoDB'
)
view_opts = Table('view_opts', metadata,
...
mysql_engine='InnoDB'
)
On 30 Maj, 17:38, neurino neur...@gmail.com wrote:
I have a
Hello,
I am trying to map a legacy schema. There are a few tables that I cannot
figure out how to map. Basically the rows are key-value pairs that
should really be columns in the table (see code examples below). The
rows of the ideal table would match the distinct values in the
physical table's
This is called a vertical table format and we have a few recipes that
illustrate this, including the examples introduced at
http://www.sqlalchemy.org/docs/orm/examples.html#vertical-attribute-mapping as
well as http://www.sqlalchemy.org/trac/wiki/UsageRecipes/VersionedMap .The
basic
Sorry if I did not specified, yes it's InnoDB.
So do I HAVE to put `mysql_engine='InnoDB'` in any Table using
ondelete cascade?
Is there a link to docs with some info on it?
Thanks for your support
On May 30, 7:04 pm, virhilo virh...@gmail.com wrote:
You need to use InnoDB engine, so you
The table has to be created with both InnoDB as well as ON DELETE CASCADE,
on the MySQL side, meaning these both must be present in the CREATE TABLE
statement used to create the tables in the database. On the SQLAlchemy side,
these options don't have any meaning outside the emission of the
Hello,
I have an issue, not sure if it is a bug or I am just screwing some
things up.
Anyway: I am using pyramid with a sqlite db in develop mode (still not
in production).
I then imported some data from csv into a table which includes a
primary key. (that is: primary key id values included in
This is a malformed date value. SQLite has no date type so SQLA must parse
it. It assumes its only parsing strings that it created. If you're
artificially generating strings to be used with DateTime, make sure you put
dates in the format as follows:
2011-03-15 12:05:57.10558
On May 30,
I just found a similar error here from FEB 2011.
http://www.mail-archive.com/sqlalchemy@googlegroups.com/msg22861.html
And similar to what happened in that thread, when I deleted the date column,
the error disappeared!!
Perhaps it has something to do with the formatting of the dates in sqlite,
14 matches
Mail list logo