The document at http://docs.djangoproject.com/en/dev/howto/initial-data/

states “If you create a fixture named initial_data.[xml/yaml/json],
that fixture will be loaded every time you run syncdb.


I copied bob to initial_data.xml

And did

pubu...@pubuntu:~/django-trunk/django/bin/mysite$ python manage.py
syncdb

but got :
Error: Couldn't install apps, because there were errors in one or more
models:
mysite.polls: __init__() got an unexpected keyword argument
'max_length'
pubu...@pubuntu:~/django-trunk/django/bin/mysite$


On Apr 22, 11:00 am, bconnors <bob.conn...@wdc.usda.gov> wrote:
> I get : No fixtures found when I do python manage.py loaddata bob
>
> pubu...@pubuntu:~/django-trunk/django/bin/mysite$ cat bob
> [
> {
> "model": "myapp.person",
> "pk" : 1,
> "fields": {
> "first_name": "John",
> "last_name": "Lenon",}
>
> ]
>
> I copied my bob file into the fixtures directory.
>
> pubu...@pubuntu:~/django-trunk/django/bin/mysite$ python manage.py
> loaddata bob
> Loading 'bob' fixtures...
> No fixtures found.
> pubu...@pubuntu:~/django-trunk/django/bin/mysite$
>
> On Apr 20, 3:28 pm, Daniel Roseman <roseman.dan...@googlemail.com>
> wrote:
>
>
>
> > On Apr 20, 8:16 pm, bconnors <bob.conn...@wdc.usda.gov> wrote:
>
> > > How do I set up a initial_data.json file? 
> > > Athttp://docs.djangoproject.com/en/dev/howto/initial-data/
>
> > > I came across this “Or, you can write fixtures by hand; fixtures can
> > > be written as XML, YAML, or JSON documents. The serialization
> > > documentation has more details about each of these supported
> > > serialization formats.
> > > As an example, though, here’s what a fixture for a simple Person model
> > > might
> > > look like in JSON:
> > > [
> > >   {
> > >     "model": "myapp.person",
> > >     "pk": 1,
> > >     "fields": {
> > >       "first_name": "John",
> > >       "last_name": "Lennon"
> > >     }
> > >   },
> > >   {
> > >     "model": "myapp.person",
> > >     "pk": 2,
> > >     "fields": {
> > >       "first_name": "Paul",
> > >       "last_name": "McCartney"
> > >     }
> > >   }
> > > ]
>
> > So, what's the problem? The instructions seem clear enough. Where are
> > you having trouble?
> > --
> > DR.- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to