Jan Dittberner
20359681db
- implement osusers.models.SshPublicKey and osusers.models.SshPublicKeyManager - fix broken osusers.models.tests.test_models - add new test classes SshPublicKeyManagerTest and SshPublicKeyTest - add migration for SshPublicKey model
37 lines
1.5 KiB
Python
37 lines
1.5 KiB
Python
# -*- coding: utf-8 -*-
|
|
from __future__ import unicode_literals
|
|
|
|
from django.db import models, migrations
|
|
import django.utils.timezone
|
|
import model_utils.fields
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('osusers', '0004_auto_20150104_1751'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='SshPublicKey',
|
|
fields=[
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
|
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, verbose_name='created', editable=False)),
|
|
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, verbose_name='modified', editable=False)),
|
|
('algorithm', models.CharField(max_length=20, verbose_name='Algorithm')),
|
|
('data', models.TextField(help_text='Base64 encoded key bytes', verbose_name='Key bytes')),
|
|
('comment', models.TextField(verbose_name='Comment', blank=True)),
|
|
('user', models.ForeignKey(verbose_name='User', to='osusers.User')),
|
|
],
|
|
options={
|
|
'verbose_name': 'SSH public key',
|
|
'verbose_name_plural': 'SSH public keys',
|
|
},
|
|
bases=(models.Model,),
|
|
),
|
|
migrations.AlterUniqueTogether(
|
|
name='sshpublickey',
|
|
unique_together=set([('user', 'algorithm', 'data')]),
|
|
),
|
|
]
|