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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:30:43+00:00 2026-06-04T00:30:43+00:00

if I have basic model for keeping track of client art: class ArtEntry(models.Model): client

  • 0

if I have basic model for keeping track of client art:

class ArtEntry(models.Model):
    client = models.CharField(max_length=50, choices=CLIENT_CHOICES)
    job_number = models.CharField(max_length=30, unique=False, blank=False, null=False)
    filename = models.CharField(max_length=64, unique=False, blank=False, null=False)
    descriptor = models.CharField(max_length=64, unique=False, blank=True, null=True)
    date = models.DateField(("Date"), default=datetime.date.today)
    post_type = models.CharField(max_length=64, choices=POST_CHOICES)

and the last field of this model is a file upload field:

    upload = models.FileField(upload_to='documents/*/**/***')

is it possible to populate the “upload_to” argument dynamically, so that * = the input ‘client’ data and ** = the input ‘job_number’ and * = the ‘post_type’ choice?

  • 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-04T00:30:44+00:00Added an answer on June 4, 2026 at 12:30 am

    Sure. Just check the docs for upload_to:

    This may also be a callable, such as a function, which will be called
    to obtain the upload path, including the filename.

    Check this answer to see an example which you can easily adapt to your problem.

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

Sidebar

Related Questions

I have a basic Django model like: class Business(models.Model): name = models.CharField(max_length=200, unique=True) email
I have a basic model: class Person(models.Model): first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) state
I have two basic models, Story and Category: class Category(models.Model): title = models.CharField(max_length=50) slug
I have a very basic model: class Link(models.Model): title = models.CharField(max_length=250, null=False) user =
I have a basic FK to user, call it owner class Baz(models.Model): owner =
Lets say we have some basic AR model. class User < ActiveRecord::Base attr_accessible :firstname,
I have a basic Core data model like this: Class -Class Name (string) Relationship:
I have a very basic Admin model: class Admin < ActiveRecord::Base has_secure_password validates_uniqueness_of :email
I have a very basic model - User I am trying to do some
I am new to MVC and have a grasp of the basic model, but

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.