models: New model to store module setup versions

This commit is contained in:
Sunil Mohan Adapa committed 2016-02-13 13:49:54 +05:30
1 parent 716ba5f1a0
commit 2bba8b07fe
2 files changed
+28

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-10 12:30
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plinth', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Module',
fields=[
('name', models.TextField(primary_key=True, serialize=False)),
('setup_version', models.IntegerField()),
],
),
]
+6
View File
@@ -37,3 +37,9 @@ class KVStore(models.Model):
def value(self, val):
"""Store the value of the key/value pair by JSON encoding it"""
self.value_json = json.dumps(val)
class Module(models.Model):
"""Model to store current setup versions of a module."""
name = models.TextField(primary_key=True)
setup_version = models.IntegerField()