1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

# -*- coding: utf-8 -*- 

 

from django.db import models, migrations 

 

 

def forwards_func(apps, schema_editor): 

# We get the model from the versioned app registry; 

# if we directly import it, it'll be the wrong version 

MailingList = apps.get_model('core', 'MailingList') 

db_alias = schema_editor.connection.alias 

MailingList.objects.using(db_alias).bulk_create([ 

MailingList(name='lxde', domain='lists.lxde.org', 

archive_url_template='http://lists.lxde.org/pipermail/{user}/'), 

]) 

 

 

class Migration(migrations.Migration): 

 

dependencies = [ 

('core', '0002_initial_data'), 

] 

 

operations = [ 

migrations.RunPython( 

forwards_func, 

), 

]