Commit c5a2bbb9 authored by Michal Čihař's avatar Michal Čihař

Use OneToOneField instead of ForeignKey(unique=True)

It's cleaner approach to define the same relation.
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 33f745ba
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('trans', '0019_auto_20150220_1354'),
]
operations = [
migrations.AlterField(
model_name='indexupdate',
name='unit',
field=models.OneToOneField(to='trans.Unit'),
preserve_default=True,
),
]
......@@ -22,7 +22,7 @@ from django.db import models
class IndexUpdate(models.Model):
unit = models.ForeignKey('Unit', unique=True)
unit = models.OneToOneField('Unit')
source = models.BooleanField(default=True)
class Meta(object):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment