kopia lustrzana https://github.com/dukethis/activitypub-example
28 wiersze
726 B
Python
28 wiersze
726 B
Python
# -*- coding: utf-8 -*-
|
|
# Generated by Django 1.11.3 on 2017-07-16 16:16
|
|
from __future__ import unicode_literals
|
|
|
|
from django.db import migrations, models
|
|
|
|
def usernames(apps, schema_editor):
|
|
Person = apps.get_model('activitypub', 'Person')
|
|
|
|
for person in Person.objects.all():
|
|
person.username = person.name
|
|
person.save()
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('activitypub', '0001_initial'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.AddField(
|
|
model_name='person',
|
|
name='username',
|
|
field=models.CharField(max_length=100, null=True),
|
|
),
|
|
migrations.RunPython(usernames, reverse_code=migrations.RunPython.noop)
|
|
]
|