Carl, Jeremy,

Thanks for your answers.

Carl wrote:

> I just made this.  it should answer most of 1 and 2.
> http://code.djangoproject.com/wiki/DatabaseReset

Somehow, it seems to me that there should be a standard utility
function to initialize the system for command line tools. I saw your
"nifty trick" twice and I used a similar approach.

Your migrate.py script seems to be very specific to your
mysql-specific use case.

Jeremy wrote:

> > What's the recommended way to access models from outside of views?

> What you have is pretty good, but do this, too, in order to make sure
> all models are loaded (so that descriptors for relationships are
> contributed to reverse models: [...]

Thanks, I changed my code.

> > 3) I need to create an object with a unique random id -
>
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/163604

Oh, it's not creating the ID, my question was whether I can safely
assume that I will always get an IntegrityError (and nothing else) and
whether just inserting stuff and catching errors is the recommended
Pythonic way.

-- 
Stefan Matthias Aust // Truth until paradox

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to