On Aug 14, 11:19 pm, "Adrian Holovaty" <[EMAIL PROTECTED]> wrote:
> On 8/14/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote:
>
> > I would suggest that rather than trying to make the --with-fixture
> > flag handle all this, it would be better to do this as a top level
> > command, i.e.:
>
> > django-admin.py testserver mydata.json accounts.json categories.json
>
> > This would also draw attention to the fact that the database that will
> > be used for the server and the data in that database are a testing
> > facility, not the main server and main database.

+1, definitely.

> > > In the future, the next step would be to keep track of any database
> > > changes and optionally serialize them back into the fixture when the
> > > server is stopped.
>
> > Cool, yes - but but also very difficult. Again, multiple fixtures are
> > the problem here.
>
> Ah, multiple fixtures are a cruel mistress. Maybe we only enable this
> feature if you're using a single fixture. If you're using multiple
> fixtures, this feature wouldn't be available.

Another solution would be for one to - one way or another - specify
which file & format to use with the writebacks, if none is specified,
no writeback is done. It wouldn't really make sense to write back to
different fixture files. Maybe:

    python manage.py testserver fixture.xml --writeback fixture.xml

Obvious issue being that, with clean code, this would open two file
descriptors and funny errors arise. Solution to that would be to use
`--writeback` as a flag saying "the next argument isn't only a fixture
to load, but write back to it as well."

Just my 2 SEK (Swedish kronor.)

Ludvig Ericson


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

Reply via email to