Indeed... I made a mistake. I was thinking of: class Image(models): image = models.ImageField(...) post = models.ForeignKey(Post)
That way you can have all images of a post like p.image_set.all() and you can construct the copy-and-paste URL. Sorry for the confusion, G On 10/19/06, berto <[EMAIL PROTECTED]> wrote: > > Sounds like you want a ManyToManyField to point to a model that > represents a file upload: > > http://www.djangoproject.com/documentation/model_api/#many-to-many-relationships > > --- > class Image(models.Model): > file = models.ImageField(upload_to="images") > > class Blog(models.Model): > subject = models.CharField(maxlength=64) > body = models.TextField() > images = models.ManyToManyField(Image, null=True, blank=True) > --- > > That's off the top of my head, but it should work. Now you can have > zero or as many images as you need in your blog post. > > -berto. > > On Oct 16, 2:38 am, "Ramdas S" <[EMAIL PROTECTED]> wrote: > > Hi, > > > > In a classic blog/content driven web app, if you need to add more than 2 > > images in an article body, what you should do? > > > > I know I can manage by creating multiple ImageFields in my model, to > > accomodate more pictures. but is there any other solutions? > > > > Suppose I need to publish some stuff that may have 10 pics inside, what > > needs to be done? Creating 10 models. image.field (blank=True) inside a > > model looks ugly. > > > > Any other ideas? > > > > Thanks > > > > Ramdas > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---