> Hope it helps,
Try as I may, I can't get it to work....  Let me show you the real code:

 

planet_names = ["Janus","Planet2"]

 

from elixir import *

metadata.bind = "sqlite:///citiesxl.db"
class Base_Planet(Entity):
 date = Field(String)
 cities = Field(Integer)

for planet_name in planet_names:
 exec(str(planet_name)+" = Base_Planet")
setup_all()
create_all()
for i in range(len(planet_names)):
 exec(str(planet_names[i])+"(date=url_date, cities=planet_numbers[i])")
session.commit()
print Janus.query.all()


-----

the key point is that I want to dynamically create the tables, meaning I can't 
hard-code the table name. So far, all of this code works.

----

Now, when I try to view the data separately, it doesn't work:

 

from elixir import *

metadata.bind = "sqlite:///citiesxl.db"
setup_all()
print metadata.sorted_tables

print Janus.query.all()

 

 
                                          
_________________________________________________________________
Windows 7: Unclutter your desktop.
http://go.microsoft.com/?linkid=9690331&ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen:112009
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to