Skip to content

Caching behavior - possibly incorrect #43

@aschriner

Description

@aschriner

I am using a foreignkey to dbtemplates Template model to determine how to display another model. ie.

class MyModel(models.Model):
    template = models.ForeignKey(Template)
    ...

When I switch the template field on MyModel to another template via the admin, MyModel is not getting the correct template for display. I get "TemplateDoesNotExist" sometimes. Other times it continues to display using the previous template. It never updates to the new template though. I have to use the admin action "repopulate cache with selected items" to get it to find the template again.

I am using a class based view and defining "get_template_names()" to get the Template model from the foreignkey.

Shouldn't the template be updating when the foreignkey is changed? And shouldn't it find the correct one either in the cache or via the database?

(Django 1.5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions