﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29529	Allow FilePathField path to accept a callable.	Sebastiaan Arendsen	Mykola Kokalko	"I have a special case where I want to create a model containing the path to some local files on the server/dev machine. Seeing as the place where these files are stored is different on different machines I have the following:

{{{
#!python
import os

from django.conf import settings
from django.db import models

class LocalFiles(models.Model):
    name = models.CharField(max_length=255)
    file = models.FilePathField(path=os.path.join(settings.LOCAL_FILE_DIR,  'example_dir'))
}}}

Now when running manage.py makemigrations it will resolve the path based on the machine it is being run on.  Eg: /home/<username>/server_files/example_dir

I had to manually change the migration to include the os.path.join() part to not break this when running the migration on production/other machine."	New feature	closed	Database layer (models, ORM)	dev	Normal	fixed	migration, filepathfield, makemigrations	Carlton Gibson Clint Dunn Herbert Fortes	Accepted	1	0	0	0	1	0
