Re: [sqlalchemy] association_proxy

2020-03-16 Thread Jonathan Vanasco
On Monday, March 16, 2020 at 12:31:09 PM UTC-4, Mike Bayer wrote: > > I sometimes get a "moderators spam report" for SQLAlchemy and then I know > I have to go to the admin interface on the website. I likely approve them > really quick before you see them. as far as originals missing i dont

Re: [sqlalchemy] association_proxy

2020-03-16 Thread Mike Bayer
I sometimes get a "moderators spam report" for SQLAlchemy and then I know I have to go to the admin interface on the website. I likely approve them really quick before you see them. as far as originals missing i dont know where to go for that. On Mon, Mar 16, 2020, at 12:13 PM, Jonathan Vanasc

Re: [sqlalchemy] association_proxy

2020-03-16 Thread Jonathan Vanasco
Mike- where do messages like these come from? The approval queue? The originals are often missing. I looked in the admin and didn't see them pending either. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide

Re: [sqlalchemy] association_proxy

2020-03-13 Thread Mike Bayer
On Wed, Mar 11, 2020, at 1:50 PM, Damian Yurzola wrote: > Folks: > > I'm trying to achieve the following. > I have a legacy table (Parent), which has a good foreign key to a tiny table > that complements it (Child). > > For the use case, querying Parent without joining with Child is not > mea

[sqlalchemy] association_proxy

2020-03-13 Thread Damian Yurzola
Folks: I'm trying to achieve the following. I have a legacy table (Parent), which has a good foreign key to a tiny table that complements it (Child). For the use case, querying Parent without joining with Child is not meaningful. class Child(Base): __tablename__ = "child" id = Column(I

[sqlalchemy] association_proxy usage in non-declarative style

2012-01-11 Thread Phazorx
Hello, i am trying to figure out how association_proxy() could be used in case of "regular" rather than declarative style definitions. I can't figure out what can be done to mitigate the issue and hence i seek help here. Thanks in advance... The code below is copy/pasted sample from the official

[sqlalchemy] association_proxy introspection

2011-03-22 Thread sandro dentella
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 attri

Re: [sqlalchemy] association_proxy as property?

2010-11-16 Thread Michael Bayer
On Nov 16, 2010, at 12:05 PM, A.M. wrote: > >> 2. implicit conversion to JSON and such is a little sloppy. You'd be >> better off using a structured approach like Colander: >> http://docs.repoze.org/colander/ > > It looks like I would have to either re-define all objects using the Colander

Re: [sqlalchemy] association_proxy as property?

2010-11-16 Thread jason kirtland
On Tue, Nov 16, 2010 at 9:05 AM, A.M. wrote: > > On Nov 16, 2010, at 11:43 AM, Michael Bayer wrote: > >> >> On Nov 16, 2010, at 11:14 AM, A.M. wrote: >>> To generate json from our SQLAlchemy model objects, we are using >>> iterate_properties to determine how to "dictify" the object. One of our >

Re: [sqlalchemy] association_proxy as property?

2010-11-16 Thread A.M.
On Nov 16, 2010, at 11:43 AM, Michael Bayer wrote: > > On Nov 16, 2010, at 11:14 AM, A.M. wrote: > >> Hello, >> >> To generate json from our SQLAlchemy model objects, we are using >> iterate_properties to determine how to "dictify" the object. One of our >> objects uses association_proxy whi

Re: [sqlalchemy] association_proxy as property?

2010-11-16 Thread Michael Bayer
On Nov 16, 2010, at 11:14 AM, A.M. wrote: > Hello, > > To generate json from our SQLAlchemy model objects, we are using > iterate_properties to determine how to "dictify" the object. One of our > objects uses association_proxy which we would like to represent in the JSON. > Unfortunately, bec

[sqlalchemy] association_proxy as property?

2010-11-16 Thread A . M .
Hello, To generate json from our SQLAlchemy model objects, we are using iterate_properties to determine how to "dictify" the object. One of our objects uses association_proxy which we would like to represent in the JSON. Unfortunately, because it is not a property, the dictification misses this

Re: [sqlalchemy] association_proxy problem

2010-07-28 Thread Michael Bayer
thanks for sending a nice, succinct example...very rare these days. Use this: class GroupClient(Base): __tablename__ = 'clientgroup' client_id = Column('client_id', Integer, ForeignKey('client.id'),primary_key = True) group_id = Column('group_id', Integer, ForeignKey('group.id'), p

[sqlalchemy] association_proxy problem

2010-07-28 Thread DimonB
Hi! When trying to remove element from association_proxy exception occure. Here is code example: ## CODE EXAMPLE # from sqlalchemy import * from sqlalchemy.ext.declarative import declarative_base, DeclarativeMeta from sqlalchemy.ext.associationproxy import

Re: [sqlalchemy] association_proxy question... I think

2009-12-02 Thread marten luter
See examples in sqlalchemy named dictlike.py und another 2 . here there are for example http://www.google.com/codesearch/p?hl=en#lIxjJFXSjns/trunk/code/prereq/SQLAlchemy-0.4.8/examples/vertical/dictlike.py&q=VerticalPropertyDictMixin&sa=N&cd=1&ct=rc On Wed, Dec 2, 2009 at 10:30 AM, Sergey V. wrot

[sqlalchemy] association_proxy question... I think

2009-12-02 Thread Sergey V.
Hi all, I've got two tables: Users (id, password) and UserProperties (user_id, name, value). Is there a way to map the properties stored in UserProperties as attributes of User object? I mean, john = User('john', 'password') john.name = "John Smith" # creates UserProperty('john', 'name', 'John S

[sqlalchemy] association_proxy only returning one object instead of a list or group of objects

2009-08-24 Thread SmokeyD
Hey everyone, I am running into a problem with association_proxy attributes in SQLAlchemy 0.5 and python 2.6. I pasted my model (a simplified version) all the way below. My model has a Permission object, Project object and a Group object, and it uses an AccessRule object to grant a permission to

[sqlalchemy] association_proxy with association object - declarative

2009-04-25 Thread GHZ
I tried to use the example from: http://www.sqlalchemy.org/docs/05/reference/ext/associationproxy.html#simplifying-association-object-relations But with declarative syntax. Any idea why this is going wrong? from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey, Sequence,

[sqlalchemy] association_proxy question

2009-02-06 Thread GHZ
I am trying to use the association_proxy for attributes that link to tables containing mostly static data e.g. my static data is: COUNTRY COUNTRY.CODE COUNTRY.NAME and the data I am changing is: USER USER.COUNTRY_CODE I use the association_proxy as I want to be able to say: user = User() user.c

[sqlalchemy] association_proxy import fail

2008-04-16 Thread Vortexmind
Hi all I'm new to python and was playing around with Elixir tutorial (a wrapper for Sqlalchemy). I get a failed import with this code from elixir import * metadata.bind = "sqlite:///movies.sqlite" metadata.bind.echo = True class Movie(Entity): title = Field(Unicode(30)) year = Field(Int