Tx a lot "Restless"...
As yr post took me a while to decipher it and get most of the info, I
thought it might be usefull to post extra info based on yr post.

Django allows for extension to the command line (./manage.py).
One of the extension is provided by Google :
http://code.google.com/p/django-command-extensions/
Installation is clearly explained :
setup.py build
setup.py install
the add the extension to your installed apps.

\T,

On Jun 11, 10:21 pm, eXt <restless.be...@gmail.com> wrote:
> On 11 Cze, 12:19, tsmets <tsm...@gmail.com> wrote:
>
> > The problem was just the naming convention ...
> > They should have been named initial_data.json as mentionned in the URL
> > provided by Xavier.
>
> > Any help on how to run python scripts directly to create my data
> > sets .... ?
> > What I do now is fine but could be better automated ?
>
> > [code]
> > from sportotop.Base.models import *
> > countries = []
>
> > countries.append(Country(iso_code='FR', name='France'))
> > countries.append(Country(iso_code='DE', name='Germany'))
> > countries.append(Country(iso_code='NL', name='Nederlands'))
> > countries.append(Country(iso_code='UK', name='United Kingdom of Great
> > Britain and Northern Ireland'))
> > countries.append(Country(iso_code='PT', name='Portuges'))
> > countries.append(Country(iso_code='CA', name='Canada'))
> > countries.append(Country(iso_code='DK', name='Denmark'))
> > countries.append(Country(iso_code='BE', name='Belgium'))
> > countries.append(Country(iso_code='SE', name='Sweden'))
> > countries.append(Country(iso_code='IT', name='Italy'))
> > countries.append(Country(iso_code='SP', name='Spain'))
> > countries.append(Country(iso_code='CR', name='Croatia'))
> > countries.append(Country(iso_code='HU', name='Hungary'))
> > for ctry in countries:
> >   ctry.save()
>
> > [/code]
>
> You can use django-command-extensions, in particular runscript command
> it provides. It allows you to run a script by calling ./manage.py
> runscript your_script.py.
> For a sample script look into scripts directory in LFC (hg 
> clonehttp://bitbucket.org/diefenbach/lfc-buildout-development/)
>
> HTH

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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