mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
models: New model to store module setup versions
This commit is contained in:
parent
716ba5f1a0
commit
2bba8b07fe
22
plinth/migrations/0002_modulestore.py
Normal file
22
plinth/migrations/0002_modulestore.py
Normal 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()),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]
|
||||||
@ -37,3 +37,9 @@ class KVStore(models.Model):
|
|||||||
def value(self, val):
|
def value(self, val):
|
||||||
"""Store the value of the key/value pair by JSON encoding it"""
|
"""Store the value of the key/value pair by JSON encoding it"""
|
||||||
self.value_json = json.dumps(val)
|
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()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user