Remove id field from mapdata models and make name their primary key

This commit is contained in:
Laura Klünder 2016-09-11 19:17:42 +02:00
parent 5397a4d2d4
commit 4b5f13ea48
6 changed files with 11 additions and 34 deletions

View file

@ -8,7 +8,7 @@ class Source(models.Model):
"""
A map source, images of levels that can be useful as backgrounds for the map editor
"""
name = models.SlugField(_('source name'), max_length=50, unique=True)
name = models.SlugField(_('source name'), primary_key=True, max_length=50)
package = models.ForeignKey('Package', on_delete=models.CASCADE, related_name='sources',
verbose_name=_('map package'))