On 3/16/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
>
> When I was talking about using the serialisation framework before, I
> wasn't actually thinking of going via the database: just serialising
> using the lower-level stuff from dictionaries or whatever. Admittedly
> some helper functions are needed, but it looks like that might be the
> case anyway if you have to construct the output format by hand in a
> template.

You've lost me here. Would you like me to lend you my sock puppets? :-)

> I don't get this argument. Either you're storing a serialized
> representation (which you said you don't want to do because it's
> repetitive) or you're not, in which case it's just a program for
> generating the serialized representation. So the latter does have the
> "simplicity of serialized representations" either, right?

I suppose the argument I'm making is that fixtures should be in the
same category as page templates. IMHO, fixtures _shouldn't_ be fully
programmable - you shouldn't have control over (or need to worry
about) saving objects or transactions or variable assignment or
complex calculations (or anything else that could mess with the
system). You just need some basic looping and data generation
facilities. The template system is good for this sort of thing; hence
using them for fixtures.

> >  and (2) the script doesn't integrate
> > with TestCases and ./manage.py in the same way as other fixtures.
>
> Hmmm. You're still going to have add something so that it actually
> generates the data somehow, right? That could be "call a template and
> get the output" or "call a Python function and get the output".

Absolutely. The question is whether we want to expose the full
capabilities of python scripting into an area which should be purely
about inserting data into the database. We certainly _could_ add the
ability for 'loaddata foo' to check if fixtures.foo is an importable
module, and if so, run it in some way - I'm just not sure that is a
good idea.

Russ %-)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to