﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
5534	stand-alone python script: no documentation avaliable	anonymous	nobody	"There is no documentation for how to write a bash python script for manage objects.
Typical use if we want to write python script for doing the same as we do in python manage shell (for example for bulk database updates)
For example, we want to run:

from mysite.polls.models import Poll
import datetime

i = 0
while i<4:
        a = str(i)
        print a
        Poll.create(question=a, data=datetime.date.today())
        i = i+1

in shell it's tedious to do. So maybe we could do it in bash:

#!/usr/bin/python
from mysite.polls.models import Poll
import datetime

i = 0
while i<4:
        a = str(i)
        print a
        Poll.create(question=a, data=datetime.date.today())
        i = i+1 

But there is missing imports. In doc there is no mention

Thanks in advance,
Xan."		closed	Documentation	dev		invalid	python script stand-alone	DXpublica@…	Unreviewed	0	0	0	0	0	0
