Hi,
I started to play with events to port a library to sqla 0.7. I managed to
use
the 'listen' function but I failed on 'remove'. Looking at the signatures
they seem to be just the same, but here is what I get:
In [7]: event.listen(obj.__class__.title, 'set', listen_cb)
In [8]:
On 18 Ago, 16:52, Michael Bayer mike...@zzzcomputing.com wrote:
remove() isn't implemented yet. While the simple operation you see below
would be fine for a single listener on a single target, the targets we have
which propagate to subclasses (mapper events, attribute events) would
On Tue, Mar 22, 2011 at 05:43:17AM -0700, sandro dentella wrote:
Hi,
i just discovered association_proxy and like it very much. It
definetely helps in some situations. I already have a library that
setup gui instrospecting the mapper, to allow editing and filtering of
records.
the only
Hi,
i just discovered association_proxy and like it very much. It
definetely helps in some situations. I already have a library that
setup gui instrospecting the mapper, to allow editing and filtering of
records.
the only way I found to get the association_proxy of a class is
checking its
Hi,
is there a way to attach an attribute extension of an existing
property of an (existing) mapper?
I made some tests [1] and it seems that attaching the AttrExt to a
mapper does not work:
mapper.get_property('name').extension = MyAttrExt()
Is there a way apart from setting it while
Thanks as usual for your valuable and prompt response
sandro
*:-)
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to
Hi,
firefox uses sqlite to store bookmark info. The file is called
places.sqlite and the schema has type LONGVARCHAR for some fields and
LONG for another. Autoloading that with sqlalchemy maps that columns
to NullType rather that to a String / Integer one. Same for LONG type
I don't really know
On 26 Ago, 18:41, Michael Bayer mike...@zzzcomputing.com wrote:
of course you'll get a cycle if you do this, though:
s1 = School(cod=S1, cod_riferimento=S1, cliente=False)
d1 = School(cod=D1, cod_riferimento=S1, cliente=False)
s1.sedi = [s1, d1]
That was it! now I got it. thanks.
s1-s1
Hi,
Let's start with the simple example based on movie/director example
class Director(Base):
__tablename__ = 'director'
id = Column(Integer, primary_key=True)
last_name = Column(String(60), nullable=False)
movies = relation('Movie',
Please, can anybody tell me what's the meaning of 'non_primary' arg of
mapper function.
I probably misunderstood it but I'd like to know what it is meant for.
thanks
sandro
On Thu, Jul 01, 2010 at 10:41:44AM -0700, sandro dentella wrote:
Hi,
I'm trying to use non_primary arg of function
Hi,
I'm trying to use non_primary arg of function 'mapper'.
Currently I have a GUI widget to browse/edit tables that is based on
introspection of the mapper.
My goal would be to reuse all the machinary of table browsing even
when browsing tables tat where built w/o primary key.
I'm ready to
Hi,
On 11 Mag, 18:23, sandro dentella san...@e-den.it wrote:
Hi,
i have a working declarative configuration that has a relation as
this::
client = relation(Cliente, backref='jobs' , lazy=False,
order_by=status.desc)
now I'd like to add a second column in the order_by field but adding
Hi,
i have a working declarative configuration that has a relation as
this::
client = relation(Cliente, backref='jobs' , lazy=False,
order_by=status.desc)
now I'd like to add a second column in the order_by field but adding a
list doesn't seem to work. I tried:
client = relation(Cliente,
': column_property(
func.my_bool(t.c.id, type=Boolean)
)
})
func 'my_bool' is a stored procedure on Postgresql and returns a boolean, but
the type of the column is NullType:
m.get_property('my_bool').columns[0].type
NullType()
--
Sandro
Hi,
I have a simple setup that may be summarized as:
class User(Base):
__tablename__ = 'user'
name = Column(String(20), primary_key=True)
class Mail(Base):
__tablename__ = 'address'
mail = Column(String(20), primary_key=True)
user_name =
Hi,
which is the correct way to see if a ForeignKey in the set
column.foreign_key is part of a compound ForeignKeyConstraint?
thanks in advance
sandro
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
I correct myself
On 12 Mag, 11:05, Alessandro Dentella san...@e-den.it wrote:
Hi,
in a sessionExtension.after_flush hook I create objects (namely todo
actions depending on what people have inserted/updated).
At present I create these objects in the current session, but I do
Thanks. I do appreciate that this will become the default as I think
that if you ask for an outer join that's what you expect.
thanks again for you time
sandro
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Missing an answer I opened ticket #1392:
http://www.sqlalchemy.org/trac/ticket/1392#preview
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to
Hi,
Mike, should I file a ticket for this?... or I just misinterpreted
the result?
sandro
*:-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to
the solution was to inherit setup.USER with a non-relative path
fossati.models.client.User.
I misinterpreted the words 'whose mapper...' and believed it was
referencing Entry.user while it is referred to setup.USER.
sandro
--~--~-~--~~~---~--~~
You received this
as soon as Ticket is persistent within the flush, the ticket.assigned_to
relation will be live and will lazy load when accessed. no commit is
needed.
mmh, in the following example, I can't use assigned_to within
after_flush.
Am I doing something wrong?
from sqlalchemy.ext.declarative import
specifically the lazy loader will work in the after_flush_postexec()
phase of the sessionextension. during after_flush(), the post-flush
bookkeeping has not been establishsed yet on assigned_to_id, and the lazy
loader always looks for the persisted version of the attribute.
ok, this
On 26 Mar, 18:04, Michael Bayer mike...@zzzcomputing.com wrote:
it would only do that if you have delete-orphan on the relation, and the
object was never saved.it will get re-added once you attach it to
that's exactly the situation I have. thanks for the explanation.
sandro
*:-)
thanks!
*:-)
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to
On 19 Feb, 13:15, a...@svilendobrev.com wrote:
if u make it the same way as the other ticket_status... key, would it
work?
No, it won't.
*:-(
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To
I realize now that autoloading a float field in Sqlite returns a
SLNumeric rather that Float. The schema is:
sqlite .schema all_types
CREATE TABLE all_types (
...
float FLOAT,
...
PRIMARY KEY (id)
);
is this a known issue?
sandro
*:-)
Hi,
in a doctest I have::
str(q) == str(query.filter(User.first_name == 'ed'))
True
that works but the following fails,
(both where built starting from the same session.query(User)
q == query.filter(User.first_name == 'ed')
True
in another place comparing str fails just because a join
Hi,
I have a code like this:
if self.session.dirty:
for dirty in self.session.dirty:
if self.session.is_modified(dirty):
return True
if self.session.new:
for obj in self.session.new:
if self.session.is_modified(obj):
return True
I realized that
I noticed in message [1] a way of getting sql statement of
meta.create_all(). It doesn't work for me:
File /tmp/sa.py, line 11, in module
gen = e.dialect.schemagenerator(e, proxy, None)
File /misc/src/hg/py/sqlkit4/bin/../sqlalchemy/sql/compiler.py,
line 777, in __init__
AttributeError:
I hope this list may be interested in this package based on
sqlalchemy.
Working with sqlalchemy has been a very nice experience, any day
discovering
some nice feature of sqlalchemy that just fitted my needs.
I know I only used a subset of SA power but my intention is to add
features as
long as I
Hi,
I think I don't see documentation on the 'match' operator that works
differently according to db backend.
If I just missed it please point me to the right place, otherwise
can you give me some more info?
How can it be used with sqlite: can it work as ~ in postgres?
If I try lo used
Hi,
I started using the .join() method on query and that' s really
powerful, with reset_joinpoint and the list of attributes setting the
path of relations. Now I'd like to being able to write join clause in
advance with respect to the moment I have the the query available , in
he same way I
least this seems to me...)
In the GUI I use as test, thoght objects are flushed but they come
back unless I issue a session.commit().
Hmm. If by come back you mean they show back up in a separate session
and still exist in the database, then it may be that you've forgotten to
commit
Hi,
I'm trying to flush deletion of single objects w/o triggering a
complete
commit and even after reading the docs several time I think I have
not got
it right. In a little test I manage to do it correctly: I delete/
flush
single objects and they are DELETEd from the table (at least
Thanks. In fact I use session.is_modified() but I thought it was just
a workaround to cope with something I didnt' thoroughly understand...
sandro
*:-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy
thanks
sandro
*:-)
--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
Hi,
is there a way to say to a session to forget all the changes to an
object without hitting the database. Expire or refresh do that but at
the prize of a new select.
Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Hi,
I'm adding validation to a (generic) gtk sql editor.
The first thing I'd like to know is if I can reach the old values
of an instance after I modified it (before committing).
The reason is that I'd like to give the possibility to have new
and old values in the validation of
to know the type
of a returned data after autoloading a Table but *before* issueing a query?
(to know wich widget should handle it).
TIA
sandro
*:-)
--
Sandro Dentella *:-)
http://www.tksql.orgTkSQL Home page - My GPL work
40 matches
Mail list logo