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 6223759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:32:42+00:00 2026-05-24T08:32:42+00:00

I want to display the selected gallery in my admin. I’m not very capable

  • 0

I want to display the selected gallery in my admin. I’m not very capable of writing custom fields and couldn’t find any well documented guidelines about it.

As for my question, I’ve written basic classes such as:

class GalleryViewWidget(forms.TextInput):
    def render(self,name,value,attrs):
        rendered = super(GalleryViewWidget, self).render(name, value, attrs)
        return rendered + mark_safe(....)

class ProductModelForm(forms.ModelForm):
    information = forms.CharField(widget=forms.Textarea)
    gallery = GalleryViewWidget
    class Media:
        css = {
            'all': (settings.MEDIA_URL + 'css/preview.css',)
        }
        js=(
                "http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js",
                settings.MEDIA_URL + 'js/preview.js',
            )
    class Meta:
        model = Product

In my preview.js file, I want to send an ajax request, the problem is I don’t know where to handle this ajax call. In my ProductModelForm ?

I’d really appreciate that if anyone gives me any knowledge about how to handle this ajax thing or another way to display selected gallery in my admin ?

  • 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-24T08:32:42+00:00Added an answer on May 24, 2026 at 8:32 am

    Here I saw a bit outdated tutorial about it…
    It creates your own thumbnails. You need to use “sorl-thumbnail” now-days for thumbnails generation and storing it’s a bit easier and more right way IMHO…

    Nevertheless it’s a tutorial of how to build a photo previews in admin. You could use it or enhance it with AJAX calls. But IMHO again it’s not necessary…

    P.S. It’s better to download full sources of this app from the start.

    so… article:

    Django Tutorial: Photo Organizer and Sharing App Part I. Enhancing Admin.

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

Sidebar

Related Questions

I want to display a custom template/item as selected item in ComboBox (this item
I want to put facility to display distance between two places selected by user.
I want to get the currently selected item (text, image, etc) and display in
I want display data from database in Listbox...Here is my code, It is not
In the header of the django admin, I want display a link. This link
friends, i am trying to display image from gallery now i want to put
i want to display selected value in drop down list . the value comes
I want to display the selected item info which is selected From the drop
I want to display multiple results of multiple selected options, here I am displaying
I have a List<> (my custom class). I want to display a specific item

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.