#5534: stand-alone python script: no documentation avaliable
-----------------------+----------------------------------------------------
Reporter: anonymous | Owner: nobody
Status: new | Component: Documentation
Version: SVN | Keywords: python script stand-alone
Stage: Unreviewed | Has_patch: 0
-----------------------+----------------------------------------------------
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.
--
Ticket URL: <http://code.djangoproject.com/ticket/5534>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---