I have the following piece of code:
transaction = session.create_transaction()
try:
# Do some work here that might fail
p=P()
p.ID=333
session.save(p)
session.flush()
# Do some more work here that might fail
p1=P()
p1.ID=333
session.save(p1)
session.flush()
# Success, commit everything
On Jun 24, 2007, at 10:52 PM, Hong Yuan wrote:
mapper(Address, address)
person_address_mapper = mapper(PersonAddress, person_address,
properties={'address': relation(Address, lazy=False)}
)
personmapper = mapper(Person, person,
properties={
'addresses':
On Jun 25, 2007, at 4:09 AM, mc wrote:
I have the following piece of code:
transaction = session.create_transaction()
try:
# Do some work here that might fail
p=P()
p.ID=333
session.save(p)
session.flush()
# Do some more work here that might fail
p1=P()
p1.ID=333
session.save(p1)
id make tables to store the expression components and their
relationships distinctly.
then again, im looking for cool things to write blog posts about.
short answer: put it in a text-based field, JSON is essentially text.
--~--~-~--~~~---~--~~
You received this
I apologize if this is the wrong place to ask this question.
I would like to store and retrieve JSON objects from a database, the
JSON object holds a list of menu items for my site. What would be the
best way to achieve this?
1. Convert the JSON object to Python code using simplejson, pickle
Thank you very much for your feedback guys! I was very worried the
whole day. I did some research and found this:
http://www.evolt.org/article/Four_ways_to_work_with_hierarchical_data/17/4047/index.html
This shows different methods of storing hierarchical data, but I just
did not like the mind
On 6/25/07, voltron [EMAIL PROTECTED] wrote:
Thank you very much for your feedback guys! I was very worried the
whole day. I did some research and found this:
http://www.evolt.org/article/Four_ways_to_work_with_hierarchical_data/17/4047/index.html
I have to say I've seen better writeups on