No sorry it's late was just typing up the scenario to be more ledgible
(i'm doing a lot with random) meant while x < 20.
Basically looks like this to add a single image model:
from django.core.files import File
from job.models import Job, JobPhoto
job = Job.objects.get(pk=1544)
lp = JobPhoto()
lp.job = job
lp.position = 1
lp.image = File(open('blah.jpg', 'r'))
lp.save()
On Sep 22, 1:48 am, nausikaa <[email protected]> wrote:
> Hi Timboy
>
> Sorry but I've never seen:
>
> for x in 20:
> # do sth.
>
> 20 is an int object and not an iterable.
> Is this snippet your code?
>
> Nausikaa
>
> On Sep 22, 10:15 am, Timboy <[email protected]> wrote:
>
> > Having issues saving model from within the shell.
>
> > Using File from from django.core.files import File
>
> >http://pastebin.com/f3030ca1e
>
> > Tried this several different ways...
>
> > TIA
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---