[sqlalchemy] Re: ORM relations...

2008-12-23 Thread Michael Mileusnich
I will try that.  I appreciate your help.  Thanks!

On Tue, Dec 23, 2008 at 12:40 PM, Michael Bayer wrote:

>
>
> On Dec 23, 2008, at 1:29 PM, Michael Mileusnich wrote:
>
> > I have a py file that creates my tables.  It does MetaData =
> > queue.metadata.  metadata.create_all().  That's all I do with
> > MetaData.  Is there additional table setup I need to be doing?
>
> yeah have it do "import filequeue; import queue;
> queue.metadata.create_all()".  or alternatively have "queue" import
> "filequeue" as well.
>
>
>
> >
>

--~--~-~--~~~---~--~~
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 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: ORM relations...

2008-12-23 Thread Michael Bayer


On Dec 23, 2008, at 1:29 PM, Michael Mileusnich wrote:

> I have a py file that creates my tables.  It does MetaData =  
> queue.metadata.  metadata.create_all().  That's all I do with  
> MetaData.  Is there additional table setup I need to be doing?

yeah have it do "import filequeue; import queue;   
queue.metadata.create_all()".  or alternatively have "queue" import  
"filequeue" as well.



--~--~-~--~~~---~--~~
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 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: ORM relations...

2008-12-23 Thread Michael Mileusnich
I have a py file that creates my tables.  It does MetaData =
queue.metadata.  metadata.create_all().  That's all I do with MetaData.  Is
there additional table setup I need to be doing?

On Tue, Dec 23, 2008 at 12:24 PM, Michael Bayer wrote:

> thats because both Table objects need to be present in the MetaData when
> used.   Ultimately your application can't run unless both "queue" and
> "filequeue" have been imported in some way.
>
>
> On Dec 23, 2008, at 1:21 PM, Michael Mileusnich wrote:
>
> I am not sure based on the project if I can have a module that imports both
> of them.  How can I use the string based ForeignKey?  I may be doing it in
> correctly because it says the table does not exist that I try to reference.
>
> On Tue, Dec 23, 2008 at 12:18 PM, Michael Bayer 
> wrote:
>
>>
>> ForeignKey accepts strings to remove the inconvenience of handling
>> circular imports.   Both dependent tables will need to be present
>> within the shared MetaData object at the point at which the Table
>> object is first used, though, so another module that imports both
>> queue and filequeue would be best.
>>
>> On Dec 23, 2008, at 10:48 AM, justmike2...@gmail.com wrote:
>>
>> >
>> > Over the last couple days I have been having an issue with relations/
>> > imports.  I have a class called queue where I define all my columns.
>> > Within queue I have a function that references a class filequeue so I
>> > need to 'from filequeues import filequeue'.  The queue class itself
>> > has relations with other classes/tables.  My problem is that within
>> > filequeue, I need to 'from queues import queue' in order to ForeignKey
>> > (queue.queueid).  Well now queue imports filequeue and filequeue
>> > imports queue causing an issue.  I tried to ForeignKey
>> > ('QUEUES.queueid') but SQLAlch says it cannot find the tables.
>> >
>> > Any ideas?
>> >
>> > >
>>
>>
>>
>>
>
>
>
>
>
> >
>

--~--~-~--~~~---~--~~
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 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: ORM relations...

2008-12-23 Thread Michael Bayer
thats because both Table objects need to be present in the MetaData  
when used.   Ultimately your application can't run unless both "queue"  
and "filequeue" have been imported in some way.


On Dec 23, 2008, at 1:21 PM, Michael Mileusnich wrote:

> I am not sure based on the project if I can have a module that  
> imports both of them.  How can I use the string based ForeignKey?  I  
> may be doing it in correctly because it says the table does not  
> exist that I try to reference.
>
> On Tue, Dec 23, 2008 at 12:18 PM, Michael Bayer  > wrote:
>
> ForeignKey accepts strings to remove the inconvenience of handling
> circular imports.   Both dependent tables will need to be present
> within the shared MetaData object at the point at which the Table
> object is first used, though, so another module that imports both
> queue and filequeue would be best.
>
> On Dec 23, 2008, at 10:48 AM, justmike2...@gmail.com wrote:
>
> >
> > Over the last couple days I have been having an issue with  
> relations/
> > imports.  I have a class called queue where I define all my columns.
> > Within queue I have a function that references a class filequeue  
> so I
> > need to 'from filequeues import filequeue'.  The queue class itself
> > has relations with other classes/tables.  My problem is that within
> > filequeue, I need to 'from queues import queue' in order to  
> ForeignKey
> > (queue.queueid).  Well now queue imports filequeue and filequeue
> > imports queue causing an issue.  I tried to ForeignKey
> > ('QUEUES.queueid') but SQLAlch says it cannot find the tables.
> >
> > Any ideas?
> >
> > >
>
>
>
>
>
> >


--~--~-~--~~~---~--~~
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 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: ORM relations...

2008-12-23 Thread Michael Mileusnich
I am not sure based on the project if I can have a module that imports both
of them.  How can I use the string based ForeignKey?  I may be doing it in
correctly because it says the table does not exist that I try to reference.

On Tue, Dec 23, 2008 at 12:18 PM, Michael Bayer wrote:

>
> ForeignKey accepts strings to remove the inconvenience of handling
> circular imports.   Both dependent tables will need to be present
> within the shared MetaData object at the point at which the Table
> object is first used, though, so another module that imports both
> queue and filequeue would be best.
>
> On Dec 23, 2008, at 10:48 AM, justmike2...@gmail.com wrote:
>
> >
> > Over the last couple days I have been having an issue with relations/
> > imports.  I have a class called queue where I define all my columns.
> > Within queue I have a function that references a class filequeue so I
> > need to 'from filequeues import filequeue'.  The queue class itself
> > has relations with other classes/tables.  My problem is that within
> > filequeue, I need to 'from queues import queue' in order to ForeignKey
> > (queue.queueid).  Well now queue imports filequeue and filequeue
> > imports queue causing an issue.  I tried to ForeignKey
> > ('QUEUES.queueid') but SQLAlch says it cannot find the tables.
> >
> > Any ideas?
> >
> > >
>
>
> >
>

--~--~-~--~~~---~--~~
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 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: ORM relations...

2008-12-23 Thread Michael Bayer

ForeignKey accepts strings to remove the inconvenience of handling  
circular imports.   Both dependent tables will need to be present  
within the shared MetaData object at the point at which the Table  
object is first used, though, so another module that imports both  
queue and filequeue would be best.

On Dec 23, 2008, at 10:48 AM, justmike2...@gmail.com wrote:

>
> Over the last couple days I have been having an issue with relations/
> imports.  I have a class called queue where I define all my columns.
> Within queue I have a function that references a class filequeue so I
> need to 'from filequeues import filequeue'.  The queue class itself
> has relations with other classes/tables.  My problem is that within
> filequeue, I need to 'from queues import queue' in order to ForeignKey
> (queue.queueid).  Well now queue imports filequeue and filequeue
> imports queue causing an issue.  I tried to ForeignKey
> ('QUEUES.queueid') but SQLAlch says it cannot find the tables.
>
> Any ideas?
>
> >


--~--~-~--~~~---~--~~
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 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---