I am building a recipe/cookbook application (something like cookpad or allrecipes) for a personal project. I have a model for image like so:
class Image(Model):
    type = (("R", "Recipe"), ("P", "Profile"), 
            ("E", "Embedded"), ("B", "Base"))
    name = models.CharField(max_length=55)
    type = models.CharField(choices=type, max_length=1, default="B")
    image = VersatileImageField(
        upload_to=FileNameGenerator(prefix="images"),
        placeholder_image=OnDiscPlaceholderImage(
            path=join(settings.MEDIA_ROOT, "images", "default.jpg")
        ),
        null=True,
        blank=True,
    )
I want to use one table only to store all image. But store it to different place for each different type.
Example:
- Base image would be at images/xxx.jpg
- Profile's image at profiles/xxxx.jpg
- Recipe's image at recipes/xxx.jpg
- etc..
The only way I know how, is to make it an abstract model and extend it. But it would create many table (ProfileImage, RecipeImage, etc..)
If I use proxy I cannot change/override the behaviour of image field.
Is there a a way to extend models but save it to the same table in database?
