models: New model to store module setup versions

This commit is contained in:
Sunil Mohan Adapa 2016-02-12 13:46:42 +05:30
parent 716ba5f1a0
commit 2bba8b07fe
No known key found for this signature in database
GPG Key ID: 36C361440C9BC971
2 changed files with 28 additions and 0 deletions

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()),
],
),
]

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()