I'm stumped...
Setup: (Problem statement near the bottom)
In my Pylons app, I have three separate models: Customer, TPPAnswer,
SAQ
TPPAnswer is many-to-one Customer
SAQ is many-to-one Customer
Both have backreferences (so saq.customer and customer.saqs)
Currently, I have them defined in
I'm getting a ProgrammingError (I've pasted the last part of the
traceback at the bottom of the page).
The error comes from my first heavy-AJAX page in Pylons (postgres
backend). If I cause too many AJAX requests at a time, or even after
doing 3 non-overlapping AJAX requests, I get the error.
, Matt Haggard wrote:
I'm getting a ProgrammingError (I've pasted the last part of the
traceback at the bottom of the page).
The error comes from my first heavy-AJAX page in Pylons (postgres
backend). If I cause too many AJAX requests at a time, or even after
doing 3 non-overlapping
:
On Jun 27, 2008, at 5:03 PM, Matt Haggard wrote:
INSERT or UPDATE? I don't do any inserts with this code... only
changing what's already there.
Is an integrity constraint a PG thing, or SQLAlchemy model thing?
its a PG thing. Other things can likely cause PG to get into this
state
In my various models, I recently noticed that I have been reusing my
customer table as it relates to many other models. I've been making
CustomerPart objects in each of the model files and retyping the table
schema and object (only including the pieces I need for that
particular case)
Now I'd
.
On Jun 16, 5:11 pm, Matt Haggard [EMAIL PROTECTED] wrote:
I've got a triple join table (joining three things together) and I'm
really struggling to get it to work as I intend. I've pasted the full
model at the bottom. I've struggled with this off and on for months
now... I don't really
I'm trying to figure out how to add objects through the ORM. (My
schema and mappings are below.)
In the shell, I can do the following:
newQ = Question()
# ... set the attributes of newQ
mytype = session.query(QType).first()
mytype.my_sections
# correctly gives all the sections that belong to
are all the Questions (ignoring the Sections;
grouping by Questions)?
my_type = Type()
all_questions = my_type.questions ??
I appreciate the help,
Matt
On May 5, 3:32 pm, Michael Bayer [EMAIL PROTECTED] wrote:
On May 5, 2008, at 5:11 PM, Matt Haggard wrote:
I've got a kind of goofy
I've got a kind of goofy schema, and I'm trying to map it. I've got
Questionnaire types, Sections and Questions all joined in a single
association table:
join_table : type_id | section_id | question_id
questions_table : id | question_text
sections_table : id | section_name
types_table : id |
the db?
2) How do I let the user know which value caused the record not to
update? What information does SQLAlchemy provide back that I can use
to say: You're number must be unique... and such-and-such must be
greater than 0, etc..?
Thanks,
Matt Haggard
Oh, okay.
Thanks you.
On Nov 20, 5:23 pm, Michael Bayer [EMAIL PROTECTED] wrote:
the aggregate methods on Query, such as apply_sum(), apply_avg(),
etc., are not in such great shape right now...they've been neglected
and in fact aren't even working correctly with GROUP BY, etc...I've
added
thank you for the response. I have a few more followup questions (I am
really a newbie to this...) :
1. Where does engine come from? Is there anyway to do what you've
suggested with Session? If it helps, I'm using this with pylons and
am trying to get stuff working in the controller of my app.
I'm very new to sqlalchemy and I'm still trying to wrap my head around
how it works.
I have a table with columns: type, amount. I want to sum the amounts
grouped by type. In SQL I would write:
SELECT sum(amount), type from purchases group by type;
How do I do this with SQLAlchemy? This is
13 matches
Mail list logo