Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7668111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:16:33+00:00 2026-05-31T15:16:33+00:00

I have given my code below. It is having a image field. I’m using

  • 0

I have given my code below. It is having a image field. I’m using django forms and custom templates to fill and store this information. And I want to allow users to upload 0 to 10 images for each book as per their wish. So how can I achieve it. My requirements are as follows:

  1. Minimum – 0 file, Maximum – 10 files
  2. Allowed file types – *.jpg, *.jpeg, *.gif, *.png
  3. Either it can be a browse file field or a button which will call a window to select multiple files.
  4. I want to save and retrieve these images and edit them in future.

models.py

class Book(models.Model):
    title       = models.CharField(max_length = 200)
    author      = models.CharField(max_length = 200)
    cost        = models.IntegerField()
    description = models.TextField()
    image       = models.ImageField(upload_to = 'images/books/', null = True, blank = True)

forms.py

class BookForm(forms.ModelForm):

    class Meta:
        model = Book
        widgets = {
            'location'   : forms.TextInput(attrs={'placeholder': 'Location'}),
            'title'      : forms.TextInput(attrs={'placeholder': 'Title'}),
            'author'     : forms.TextInput(attrs={'placeholder': 'Author'}),
            'cost'       : forms.TextInput(attrs={'placeholder': 'Price'}),
            'description': forms.Textarea(attrs={'placeholder': 'Description'}),
        }

Before asking this question, I tried Garmoncheg django_multiuploader and Scompt multifile widget. But none of them helped me. I’m working on this task for the past two days, but couldn’t get it working. So Please suggest me a way of completing this task successfully.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:16:34+00:00Added an answer on May 31, 2026 at 3:16 pm

    What I would do is separate the “image” field into a separate model entirely, then use an inline formset factory to upload multiple images for a Book.

    Have a look at the formset documentation, and I think you’ll catch on pretty quickly. Hope that helps you out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have given a table background image using css background-image property. The cells are
I'm having a problem with an image and some text. I have this code:
I have the two images below. They are the same image, with one having
I'm having trouble passing an array between methods and have excerpted my code below.
I have a code like this below, which gives me a $link that equals
given i have the following block of code (function(){ var mb = { abc:function(){
I have the following html code (in the given order) <div id=content>...</div> <div id=footer>...</div>
I have the following code (generates a quadratic function given the a, b, and
I have this code which gives me the below output in firebug, so according
I am having a problem in the program code as I have changed my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.