On Jun 10, 2011, at 2:25 PM, Cody Django wrote:
> Hi all -- I'm new on pylons, coming from a django background. I'm
> working on a mapfish project.
>
> I'd like to "autoload" a model based on a db table, but in doing so I
> get the error "could not assemble any primary key columns for mapped
> table".
>
> The table itself is a postgres "view" with no "declared" primary key
> column, so it makes sense that no primary key columns are detected.
>
> I figure it is possible to define which columns to use as the primary
> key in the __table_args__ dict, but I have yet to figure out exactly
> how.
>
> Tips, please!
I do the same thing:
newtable = Table(name,
meta,
*props,
autoload=True
)
where props = ColumnCollection(Column('id',Integer,primary_key=True))
SQLAlchemy overwrites the autoloaded info with the passed-in column info.
Cheers,
M
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.