Hi ,
I am testing sqlalchemy-migrate with a DB revision script that adds a
table to my database. Two questions here, but first system info:
TG2 Framework (tg.devtools 2.0.2) with
sqlalchemy_migrate-0.5.2-py2.6.egg
MySQL 5.1.41
sqlalchemy V0.5.1
OS X 10.6.4
1) How do I use DeclarativeBase when d
The most logical place would seem to be the database - create a unique
constraint on the 'name' column, or even make the name column the
primary key rather than the integer ID.
On Jun 16, 12:29 pm, Rich wrote:
> Two part question... I have a table of activity types . I want to
> follow a ‘singlet
Two part question... I have a table of activity types . I want to
follow a ‘singleton pattern’ (ie. Only one instance of
‘run’,’jump’,’swim’ etc.). I have a get_or_create function on the
class that works as long as programmers using my module call:
session.add( ActivityType.get_or_create(‘fly’))
It worked! Thanks, this helped me a lot.
On Jun 16, 10:36 am, Michael Bayer wrote:
> I'd use column.copy() for this purpose.
>
> On Jun 16, 2010, at 10:32 AM, BearDeer wrote:
>
>
>
> > Hi guys,
>
> > In sqlalchemy 0.6.1, had a TypeError when trying to do:
> > deepcopy(Column('id', Integer, Sequen
I'd use column.copy() for this purpose.
On Jun 16, 2010, at 10:32 AM, BearDeer wrote:
> Hi guys,
>
> In sqlalchemy 0.6.1, had a TypeError when trying to do:
> deepcopy(Column('id', Integer, Sequence('id_seq'), primary_key=True)).
> But in 0.5.8 the above code works fine, could some one tell me
Hi guys,
In sqlalchemy 0.6.1, had a TypeError when trying to do:
deepcopy(Column('id', Integer, Sequence('id_seq'), primary_key=True)).
But in 0.5.8 the above code works fine, could some one tell me what
causes this error or how can I fix it?
Thanks in advance.
--
You received this message becau
Is there a book that is more current that you recommend?
Thanks
On Jun 16, 7:35 am, Michael Bayer wrote:
> unfortunately Essential SQLA is sorely out of date, save() was moved to add()
> around the time of late 0.4 and in 0.6 we've removed the old save().
>
> On Jun 16, 2010, at 9:31 AM, Aref w
Thank you so much. I'll make a note of that.
On Jun 16, 7:35 am, Michael Bayer wrote:
> unfortunately Essential SQLA is sorely out of date, save() was moved to add()
> around the time of late 0.4 and in 0.6 we've removed the old save().
>
> On Jun 16, 2010, at 9:31 AM, Aref wrote:
>
>
>
> > Hell
Goddit !! Thank you so much!!
On 16 June 2010 14:33, Michael Bayer wrote:
>
> On Jun 16, 2010, at 7:58 AM, Robert Sudwarts wrote:
>
> Hi,
>
> I'm having difficulty understanding how to call/create a session to access
> a "class method" of a declaratively defined table/object: essentially my
>
unfortunately Essential SQLA is sorely out of date, save() was moved to add()
around the time of late 0.4 and in 0.6 we've removed the old save().
On Jun 16, 2010, at 9:31 AM, Aref wrote:
> Hello,
> I am learning sqlalchemy and been reading and working through the
> examples/tutorials in Copelan
On Jun 16, 2010, at 7:58 AM, Robert Sudwarts wrote:
> Hi,
>
> I'm having difficulty understanding how to call/create a session to access a
> "class method" of a declaratively defined table/object: essentially my
> understanding of how session works in this context is at fault... Clearly,
> t
Hello,
I am learning sqlalchemy and been reading and working through the
examples/tutorials in Copeland's "Essential SQLAlchemy".
I am running sqlalchemy 0.6.1 and python2.5
I am running into a problem when trying to save a session using save.
session.save(newuser)
for example. I get an error say
its not really provided right now, the same way saying query.filter(None) won't
reset any existing WHERE criterion, or join(None) doesn't remove all joins.
This issue has come up before. How is order_by() different ?
On Jun 16, 2010, at 8:05 AM, Andi Albrecht wrote:
> Hi,
>
> I'm a bit cu
Hi :)
Take a look at this sample: http://paste.pocoo.org/show/226056/
The update is performed in the line 42. update() is a query operation :)
See official docs:
http://www.sqlalchemy.org/docs/reference/orm/query.html#sqlalchemy.orm.query.Query.update
Best regards,
Francisco Souza
Software deve
Hi,
I'm a bit curious about how to unset an order_by in 0.6.
query.order_by(None) should do it, but in sqlalchemy/orm/query.py in
_no_select_modifiers() the notset value for the _order_by attribute is
False. In turn, the order_by() method doesn't seem to accept False.
What would be a proper way
Hi,
I'm having difficulty understanding how to call/create a session to access a
"class method" of a declaratively defined table/object: essentially my
understanding of how session works in this context is at fault... Clearly,
the @classmethod requires a **session** (and I realise that: "declarat
On Jun 15, 6:59 pm, Michael Bayer wrote:
> So no, calling gc.collect() is not necessary under normal circumstances, it
> is only needed here to for the purposes of the method of testing.
Ok, thanks. I've done some more digging and find that there *are* some
references knocking around, but not su
17 matches
Mail list logo