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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:28:21+00:00 2026-05-24T11:28:21+00:00

From the grappelli customization document, it suggested that: The sortable-field will not automatically be

  • 0

From the grappelli customization document, it suggested that:

    The sortable-field will not automatically be hidden
 (use a Hidden Input Widget if needed).

However, i have searched for so long and have no idea on what is a “Hidden Input Widget” and how i could be implemented to a Django model. Here is my code:

     # models.py
class video(models.Model):
    category = models.ForeignKey(subCategory)
    index = PositionField('index')
    video_title = models.CharField(max_length=255, blank=True, null=True)
    video_desc = models.TextField(blank=True, null=True)
    main_img = S3EnabledImageField(upload_to='video_img', blank=True, null=True)
    small_img = S3EnabledImageField(upload_to='video_img', blank=True, null=True)
    mid_img = S3EnabledImageField(upload_to='video_img', blank=True, null=True)
    large_img = S3EnabledImageField(upload_to='video_img', blank=True, null=True)
    last_updated = models.DateField(auto_now=True)
    date_added = models.DateField()
    date_modified = models.DateField()
    date_published = models.DateField(blank=True, null=True)
    date_closed = models.DateField(blank=True, null=True)
    status = models.CharField(max_length=7,choices=STATUS_CHOICE)

    class Meta:
        ordering = ('index',)
        verbose_name = 'Video'
        verbose_name_plural = 'Video'

    def __unicode__(self):
        return self.video_title

class video_file(models.Model):
    video = models.ForeignKey(video)
    index = models.PositiveIntegerField()
    file_title = models.CharField(max_length=255, blank=True, null=True)
    #main_file = models.ImageField(upload_to='phoneso/video_file', blank=True, null=True)
    main_file = S3EnabledFileField(upload_to='video_file')
    resolution = models.CharField(max_length=50, blank=True, null=True)
    file_format = models.CharField(max_length=50, blank=True, null=True)
    date_added = models.DateField(auto_now_add=True)
    date_published = models.DateField(auto_now_add=True)
    status = models.CharField(max_length=7,choices=STATUS_CHOICE)

    class Meta:
        ordering = ('index',)
        verbose_name = 'Video File'
        verbose_name_plural = 'Video File'

    def __unicode__(self):
        return self.video.video_title

# admin.py

class video_fileInline(admin.TabularInline):
    fields = ('main_file' , 'resolution' , 'file_format' , 'status', 'index',)
    sortable_field_name = 'index'
    model = video_file
    extra = 1

class videoAdmin(admin.ModelAdmin):
    list_display = ('index' ,  'video_title', 'category' , 'date_added' , 'date_published' , 'status')
    search_fields = ['video_title', 'desc']
    readonly_fields = ('date_added','date_modified')
    list_filter = ['category']
    inlines = [video_fileInline]

class video_fileAdmin(admin.ModelAdmin):
    list_display = ('index' ,  '__unicode__' , 'file_title', 'resolution' , 'file_format' , 'main_file' , 'date_added' , 'date_published' , 'status')
    search_fields = ['video_title', 'desc']

Where should i implemented the suggested “Hidden Input Widget”?

Thank you.

  • 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-24T11:28:22+00:00Added an answer on May 24, 2026 at 11:28 am

    You can write a form for your model and use it in video_fileInline:

    forms.py

    class VideoFileForm(forms.ModelForm):
        def __init__(self, *args, **kwargs):
            super(VideoFileForm, self).__init__(*args, **kwargs)
            # key should be your sortable-field - in your exaple it's *index*
            self.fields['index'].widget = forms.HiddenInput()
    
        class Meta:
            model = video_file
    

    admin.py

    class video_fileInline(admin.TabularInline):
        fields = ('main_file' , 'resolution' , 'file_format' , 'status', 'index',)
        form = VideoFileForm
        sortable_field_name = 'index'
        model = video_file
        extra = 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From the Collections Framework Overview : Collections that do not support modification operations (such
From a blog: The basic idea with CSS expressions is that you will have
I understand that one can use pip to install packages from svn etc. ala:
From years I am hearing that soon IPv4 address will run out. When will
From what I can gather, there are three categories: Never use GET and use
From the official documentation: A subclass of Dialog that can display one, two or
From here , Using inheritance, which of the following is not allowed a) Changing
From viewing the source code that this code makes it looks like itemValue generate
From this article I see I can use msbuild to apply configuration transformations but
From what I've ready you should be able to use the 'value' property of

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.