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

  • Home
  • SEARCH
  • 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 9186809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:37:17+00:00 2026-06-17T19:37:17+00:00

I have a table of static data, loaded via initial_data.json. The admin interface apparently

  • 0

I have a table of static data, loaded via initial_data.json. The admin interface apparently displays the data ordered by descending pk; i.e. the records with the largest pk are at the top of list. I would like to reverse this, ideally by using the pk value. Since it’s static data, I could add another column for the sort order, but that would essentially duplicate the pk values, or I could, when generating my fixture file, use “pk=len(data)-i” instead of the “pk=i” that I’m currently using. But really, I’d like to just say something like this:

class DataAdmin(admin.ModelAdmin):
    ordering = ('row_id',)

I’ve tried using ‘row_id’, ‘id’, and ‘pk’, without success. Does anyone have any ideas beffore I go source-diving? Thanks!

  • 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-06-17T19:37:19+00:00Added an answer on June 17, 2026 at 7:37 pm

    Put the ordering on the actual model in its Meta class

    class YourModel(models.Model):
        class Meta:
            ordering = ['pk']
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table called 'choices' in this table i am storing static data
I have static data in a single table which I must serialize. I have
I have a table of data from mysql rendered on page via PHP into
A real beginner here, I am looking to have a table of static data
I have a table named ServiceProviders with static data. The POCO class is follows
I have a fairly static (InnoDB) table T with four columns: A , B
I have a method private static DataTable ParseTable(HtmlNode table) and sometimes this method has
I have table with 300 000 records (MyISAM). I get record from this table
I have table of data that is sorted as follows: Item | Sample |
I have a table of data being produced with JavaScript. At the end 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.