On Aug 15, 1:05 am, Michael Bayer mike...@zzzcomputing.com wrote:
A relationship() can be added at any time to any mapped class - when using
declarative config, just assigning it to the class is all that's needed,
mapper.add_property() is called as a result. Using backref where you
had
I'm writing a package for Pyramid which has a base AuthUser
declaration. I want to allow users that have installed the package the
ability to extend the AuthUserProfile so that the Mako templates can
be accessed with my subscriber which populates user. with the AuthUser
properties.
Currently, it
easy_install (for
Pyramid), then, allow the user to extend the class locally. So, the
person installs my package, but, needs to be able to extend
user_profile themselves.
https://github.com/cd34/pyramid_apex/blob/master/pyramid_apex/views.py
The issue I'm running into currently is that in the model
uid was the logged in user's id. I didn't grasp the bindparam/
eagerload dependency and almost had that solution working. That wiki
page clarified it.
As always, thank you for the quick response.
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
I'm trying to pass a value to a relation at runtime rather than
instantiation time. I've got the callable working with a fixed value,
but, in reading the docs over the last few days , I'm either not
finding the proper incantation or the right terms in the documentation
to figure out what I'm
By forcing my join, it appears that I can get it to do what I wanted.
After thinking a bit about the ORM, doing what I wanted 'magically'
would have been quite a feat.
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send
On Sep 19, 12:36 pm, Michael Bayer mike...@zzzcomputing.com wrote:
If I reference order_by=Block_element.sorttree, paster crashes with
the same error.
order_by='somestr' with declarative means the string is a Python eval. So if
you wanted to put the name of the Table here, its
I've tried to pull out as much cruft and redesign to get the bare
minimum model to make it easier to use the collection_class.
What I'm trying to do:
page.template.blocks[0].elements[0]
as
page.template['content'].elements[0]
Right now, I get:
page.template.blocks[0].name = 'content'
Renamed the association_proxy now that I understand how it works and
what I was doing wrong. I ended up with
model/cms.py:
class Template(Base):
__tablename__ = 'm_template'
id = Column(mysql.BIGINT(20, unsigned=True), primary_key=True,
autoincrement=True)
name =
meta.Session.query(Job).order_by(Job.min_level).order_by(Job.descr).filter(Job.tier==1).outerjoin((User_job_progress,
User_job_progress.job_id==Job.job_id)).filter(User_job_progress.fb_uid==1)
results in a query of:
FROM xxx_jobs LEFT OUTER JOIN xxx_user_job_progress ON
Just not having a lot of luck here. :)
meta.Session.query(Job).order_by(Job.min_level).order_by(Job.descr).filter(Job.tier==1).outerjoin((User_job_progress,
and_(User_job_progress.job_id==Job.job_id,
User_job_progress.fb_uid==1))).all()
results in:
SELECT xxx_jobs.job_id AS xxx_jobs_job_id,
% for job,progress in tmpl_context.jobs:
error on my part after the outerjoin.
Thanks for the pointers in the right direction.
--
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
I have 4 tables: users, jobs, job_items, job_progress
class User(Base):
__tablename__ = 'xxx_users'
fb_uid = Column(mysql.MSBigInteger(20, unsigned=True),
primary_key=True)
class Job(Base):
__tablename__ = 'xxx_jobs'
job_id = Column(mysql.MSBigInteger(20, unsigned = True),
That's what I thought about 10 minutes after posting. I thought there
might be a trick in the DeclarativeBase declaration that I missed.
Thanks for the quick reply.
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email
I've run into a minor stumbling block.
My metadata table is set up as a relationship rather than
Base.metadata. Since I needed to expose sorttree which would attached
to the Base.metadata record, I was unsure how to modify that record
using normal methods. I'm thinking that I might be able to
I have a Declarative Base model that is laid out like:
content - page - block
block
block
block is a meta that points to a block table and a further object of
element. page is a many to many to block placement, but, is a one to
one to
I've got a schema that I was having problems with last night. I got
it working, but, it seems somewhat dangerous unless I force lazy
loading:
class User(Base):
__tablename__ = 'xxx_users'
fb_uid = Column(mysql.MSBigInteger(20, unsigned=True),
primary_key=True)
friends =
as I stumble across join_depth :)
Had I just waited another five minutes to post.
--
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
On Oct 30, 4:44 am, Shane shane.luttr...@gmail.com wrote:
I am using SA within TurboGears. When saving data from form fields, I
often have a dict of key/value pairs (where values is always a string
and must by correctly typed) where each key is set up to correspond to
a column within the SA
On Oct 31, 12:00 am, cd34 mcd...@gmail.com wrote:
On Oct 30, 4:44 am, Shane shane.luttr...@gmail.com wrote:
I am using SA within TurboGears. When saving data from form fields, I
often have a dict of key/value pairs (where values is always a string
and must by correctly typed) where each
On Oct 21, 11:09 am, webdexter webdex...@gmail.com wrote:
I have to develop an web interface for a database created by
sqlAlchemy. First I was thinking using django but after few days I am
thinking that using SA and django, moreover on an already existing
project, is not a good idea because
On Oct 17, 6:49 pm, Jeff Cook cookieca...@gmail.com wrote:
Unfortunately, from a support-seeker point of view, such rhetoric is
often necessary. How many times have you written a mailing list or hit
sqlalchemy.pool_recycle = 10
I had odd issues -- even though mysql was set to
|
I'm using SQLAlchemy 0.5.6, Python 2.5.4, Debian Linux
I have a defined schema but am experimenting with a different way to
display the data. While I have gotten a portion of this working, I am
stuck putting the second condition into the primaryjoin. Classes have
been clipped for brevity.
On Oct 17, 1:36 am, Michael Bayer mike...@zzzcomputing.com wrote:
At the moment you have an and_() of two string expressions, which
SQLalchemy knows nothing about and therefore cannot apply mapping
logic to it. When using declarative, you do have the option to quote
the expression
24 matches
Mail list logo