Hi,

I want to be able to use my ORM objects (eg, EmailMessage,
EmailAddress) in some cases without a database. For example, I want to
write a function like download_email_messages that will download email
messages and return an EmailMessage object which has a set of
EmailAddress objects (for the To, From, etc.). The database is not
involved at this stage.

While I can easily create the EmailMessage object and its
corresponding EmailAddress objects, when I try to iterate over the
EmailMessage object's EmailAddresses objects I get an error because
Django ORM tries to access the database. Is there any way to use
Django ORM in a disconnected mode, or something like that? (this is
what I used to do with SQLAlchemy in all my applications and it works
great...)

This is what I wanted to do:

messages = download_messages()
for message in messages:
     # accessing message.from_address raises
django.db.models.base.DoesNotExist
     message.from_address.save()
     for address in messages.to_addresses:
          address.save()
     message.save()

Thanks!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to