On Aug 13, 2:37 pm, Anton Gritsay gene...@angri.ru wrote:
Hi, Allen!
You can use something like this (yeah, I know that it isn't
declarative in any way):
class Node(Base):
__tablename__ = 'node'
id = Column(Integer, primary_key=True)
parent_id =
On Aug 7, 11:45 am, Michael Bayer mike...@zzzcomputing.com wrote:
AF wrote:
Hello,
I have a table of records in the database that I want to run read
queries against, but I do want to include all of them in the search.
(There are a couple of filtering parameters to exclude records
Werner,
On Aug 7, 12:36 pm, werner wbru...@free.fr wrote:
Allen,
allen.fowler wrote:
On Aug 6, 6:54 pm, AF allen.fow...@yahoo.com wrote:
Hello all,
Has anyone here used the sqlamp: Materialized Path for SQLAlchemy
library?
I am wondering:
1) Does it seem to work well?
2
On Aug 9, 1:42 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Aug 9, 2009, at 1:24 PM, allen.fowler wrote:
So, just to clarify:
At this point in time, can SQLAlchemy be used to define and query
simple VIEWs in a database agnostic manner?
And if not, is this a feature
On Aug 6, 6:54 pm, AF allen.fow...@yahoo.com wrote:
Hello all,
Has anyone here used the sqlamp: Materialized Path for SQLAlchemy
library?
I am wondering:
1) Does it seem to work well?
2) Did you use it with Declarative Base, and if so, how did you
configure it?
Anybody?
On Aug 7, 11:45 am, Michael Bayer mike...@zzzcomputing.com wrote:
AF wrote:
Hello,
I have a table of records in the database that I want to run read
queries against, but I do want to include all of them in the search.
(There are a couple of filtering parameters to exclude records
... To clarify:
I am using SQLAlchemy's Declarative Base to fully define and create my
database.
For instance, there is a simple class/table Records, and I would like
to define a class CurrentRecords that is implemented in the database
as a view on Records.
In this way, I can
On Aug 6, 3:30 am, werner wbru...@free.fr wrote:
I never do this, i.e. I assign like this
add = Address()
add.email_address = 'an email address' In what way is the Address object
expected to be instantiated such
that it receives the correct user id?
You just do this and SA will take
On Aug 6, 4:59 am, Wichert Akkerman wich...@wiggy.net wrote:
On 8/6/09 09:30 , werner wrote:
IIRC correctly the __init__ section is only needed if you want to do:
add = Address('an email address')
I never do this, i.e. I assign like this
add = Address()
add.email_address = 'an
On Aug 5, 6:29 pm, AF allen.fow...@yahoo.com wrote:
Hello,
Where do you folks recommend storing the database connection string in
my application. Clearly not in the same file with my declaratively
defined model objects.
And more generally, how do you recommend laying out an SQLAlchemy
On Aug 6, 4:05 pm, Michael Bayer mike...@zzzcomputing.com wrote:
allen.fowler wrote:
I tried:
children = relation(Node, backref=backref(parent,
remote_side=nodes.id))
got it to work with:
remote_side=[id]
But:
1) Why is remote_side a list?
in this case you could just say
On Jul 28, 12:17 pm, David Gardner dgard...@creatureshop.com wrote:
Just thought I would toss in my 2-cents here, since I have lots of
hierarchical data and have
at one time or another used most of the below methods.
Choice #1 is the option that I have found that works the best.
I Use a
On Jun 30, 11:25 am, Didip Kerabat did...@gmail.com wrote:
If you are open to non RDBMS solution, sounds like what you need is message
queue system.
At work, we use RabbitMQ (memory-only) and have been quite happy with it.
SecondLife posted their discovery about MQ
I've attached a proof of concept for how I've approached the homegrown
version of this in the past. a jobs table has two update passes - one to
atomically mark jobs as in progress by a certain procid, then the
transaction is released so that other processes can theoretically work on
other
I have several CGI and cron scripts and that I would like coordinate
via a First In / First Out style buffer. That is, some processes
are adding work units, and some take the oldest and start work on
them.
Since I need the queue to both survive system crashes and provide an
audit
If you have mapper definitions separate from classes, theres nothing
stopping you from adding attributes to the class over there, i.e.
mapper(MyClass, mytable)
MyClass.foo = some_validation_decorator(MyClass.foo)
Personally I wouldn't bother (then again I use declarative for everything
Thank you, Michael.
On Jun 18, 9:41 am, Michael Bayer mike...@zzzcomputing.com wrote:
On Jun 18, 2009, at 2:27 AM, AF wrote:
OK, next question.
Well... two related questions. :)
1) In general, inside an object's method def, where I am doing
arbitrary calculations, how can I get
OK, never mind... I solved it.
The default = random.randrange(1000,1) code was happily taking the
static return value. Duh.
I changed it to:
default = lambda: random.Random().randrange(2000,8000)
I dunno if the extra Random() is needed, but it can't hurt, right?
On Jun 21, 4:32 pm,
default = lambda: random.randrange(1000,1)
Seems we crossed in the interwebs.. :)
Is it safe to do this, or do you need to do default = lambda:
random.Random()randrange(1000,1) ?
I ask since I have several tables that this needs to be applied to.
Thank you
3) Can this relation's objects be made read-only? That is:
u.room = new_room would work, but this would not: u.room.name =
'kitchen'
To clarify the question:
Can this objects seen via this relation be made read-only? That is:
u.room = a_room
u.room = a_new_room
...would work fine.
And
you can, you can use a validator that rejects all changes, or if
you're
brave you can create a custom __setattribute__ method that brokers all
attribute setter access. the former is in the SQLA mapping docs the
latter is part of Python.
Thank you. Interesting seems a bit of a round
Anybody?
On Jun 4, 1:13 am, AF allen.fow...@yahoo.com wrote:
Hello,
I'm using sqlite and convert_unicode = True on the engine.
How can I force coerce string based object attributes in to unicode?
(I had thought convert_unicode = True would do this)
Here is what I am seeing...
Setup
On Jun 12, 6:00 am, Gunnlaugur Briem gunnlau...@gmail.com wrote:
The engine's conversion to unicode doesn't happen when you assign the
property, it happens when the underlying database operation is
committed, and arrives in the python object's property only after
roundtripping through the
23 matches
Mail list logo