Hi all,
I've searched through the documentation and google on this and haven't been
able to find an answer. I have the following class:
class Price(Base):
__tablename__ = prices
id = Column(Integer, primary_key = True)
company_id = Column(Integer, ForeignKey('companies.id'))
Thanks Simon -- that's what I was missing.
On Thursday, August 15, 2013 5:01:31 AM UTC-4, Simon King wrote:
(Sorry for any mistakes, I'm on my phone)
Think of the database structure that you've got: your creators table has
id, creator and company_id columns. company_id is a foreign key
Simon, your idea about putting together a script is a good one. Please see
the attached. I think all these errors are related but I'm scratching my
head about what the problem is.
The reason I use self.creator[0] versus self.creator is for aesthetics.
And, to your point about creator not
I'm afraid there are still some bugs in here that hopefully you can help
with.
class Creator(Base):
__tablename__ = creators
id = Column(Integer, primary_key = True)
company_id = Column(Integer, ForeignKey('companies.id'))
creator = Column(String(100), nullable=False,
Thanks Michael!
On Sunday, August 11, 2013 4:33:20 PM UTC-4, Michael Bayer wrote:
On Aug 11, 2013, at 3:06 PM, csd...@gmail.com javascript: wrote:
I'm having problem with the following code which is designed to remove an
object identified as malformed prior to session.commit():
if
I have another question about a piece of code that I posted the other day.
Namely, I have a one-to-many relationship between Creator and Company. A
Creator can have a relationship with multiple Companies but any one Company
can have a relationship with only one Creator.
class Company(Base):
Sorry I don't understand what you're trying to say.
If the Creator already exists, and I'm to append it again, isn't that the
same as what my code is currently doing? (That is, appending in every
instance.) I don't see how this wouldn't result in the same error message.
And what would it mean
Very helpful, thanks Tim :)
On Monday, August 12, 2013 9:53:48 PM UTC-4, Tim wrote:
Ad, one more try:
existing_creator = DBSession.query(Creator).filter_by(name=creator).first()
--
Tim Van Steenburgh
On Monday, August 12, 2013 at 9:50 PM, Tim Van Steenburgh wrote:
Sorry, that
I'm having problem with the following code which is designed to remove an
object identified as malformed prior to session.commit():
if tickers[x] not in existing_tickers and company_names[x] not in
existing_companies:
company = Company(tickers[x], company_names[x], creators[x], links[x])
Thank you! That worked.
On Saturday, August 10, 2013 5:39:31 AM UTC-4, Simon King wrote:
On 10 Aug 2013, at 03:42, csd...@gmail.com javascript: wrote:
This is driving me a little crazy so hopefully someone here can help.
This is my first time working with sqlalchemy (v0.8). Python is
This is driving me a little crazy so hopefully someone here can help. This
is my first time working with sqlalchemy (v0.8). Python is v2.7.2 and MySQL
is v14.14.
The (heavily) summarized code is as follows:
class Price(Base):
__tablename__ = prices
id = Column(Integer, primary_key =
11 matches
Mail list logo