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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:40:46+00:00 2026-05-30T07:40:46+00:00

I have heard it might not be made for this, but I’d really like

  • 0

I have heard it might not be made for this, but I’d really like to have it just take the file’s name for the slug and title.

class RandomAdmin(admin.ModelAdmin):
    prepopulated_fields = {
        'slug': ('image',),
        'title': ('image',)
    }

where ‘image’ is an ImageField…

image = models.ImageField(upload_to="random_uploads")

If the files name is ‘abc_123.jpg’, I get ‘cfakepathabc_123jpg’. I’d like to get ‘abc_123jpg’ or ‘abc_123’.

Any tips for me? 🙂

  • 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-30T07:40:46+00:00Added an answer on May 30, 2026 at 7:40 am

    Cannot be done trivially, without modifying prepopulated_fields_js.html, since it just looks for the value of the dependent fields.

    In otherwords, you can’t just do it by changing something in the ModelAdmin. You’d have to override prepopulated_fields_js.html and make some specific exceptions.

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

Sidebar

Related Questions

I might have a flawed understanding of what shared_examples_for should do, but hear me
I have heard it many times that garbage collection in PyS60 is not up
I have heard that GTK covers all controls so that developers do not care
This is not a real situation; please ignore legal issues that you might think
Basically I am not using a MasterPage and I just have a project with
I have a table which looks like this: CREATE TABLE `library_mix` ( `lib_mix_id` VARCHAR(64)
I hope many of you might have heard about well knows mars rover problem
I have made a custom CMS and I'd like to make it multi-client while
Okay the question title may not have made sense... mostly because I don't know
Question title might be meaningless, but I tried. :) Here's my situation: I have

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.