Searching and Deleting Cache Entries in Admin tool

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# models.py

class CacheTable(models.Model):
    cache_key = models.CharField(max_length=255, primary_key=True)
    value = models.TextField()
    expires = models.DateTimeField(null=True, blank=True, default=None)

    class Meta:
        db_table = '<cache-table-name>'


# admin.py


class CacheTableAdmin(admin.ModelAdmin):
    list_display = ('cache_key', 'expires')
    search_fields = ('cache_key', )

admin.site.register(CacheTable, CacheTableAdmin)

More like this

  1. multiblog - a simple example of row-level permissions in the admin by simon 5 years, 7 months ago
  2. simple guestbook by laxu 5 years, 7 months ago
  3. Quickly create an admin interface for an app. by bartTC 3 years, 7 months ago
  4. django app name & breadcrumbs l10n by xormag 2 years, 9 months ago
  5. cache_smart template tag by michiel_1981 6 years, 1 month ago

Comments

(Forgotten your password?)