Set default of item.weigth to 10000.

So new items are placed at the end of agenda.
After sorting weight is updated.
This commit is contained in:
Emanuel Schuetze 2016-01-27 21:31:06 +01:00
parent fc22711a9c
commit 3c7d03547c
4 changed files with 23 additions and 2 deletions

View File

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-27 21:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('agenda', '0002_auto_20160122_2318'),
]
operations = [
migrations.AlterField(
model_name='item',
name='weight',
field=models.IntegerField(default=10000),
),
]

View File

@ -233,7 +233,7 @@ class Item(RESTModelMixin, models.Model):
The parent item in the agenda tree.
"""
weight = models.IntegerField(default=0)
weight = models.IntegerField(default=10000)
"""
Weight to sort the item in the agenda.
"""

View File

@ -99,7 +99,7 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
default:
return false;
}
}
};
// open new dialog
$scope.newDialog = function () {
ngDialog.open({

View File

@ -244,6 +244,7 @@ class Numbering(TestCase):
self.client.login(username='admin', password='admin')
self.item_1 = CustomSlide.objects.create(title='test_title_thuha8eef7ohXar3eech').agenda_item
self.item_1.type = Item.AGENDA_ITEM
self.item_1.weight = 1
self.item_1.save()
self.item_2 = CustomSlide.objects.create(title='test_title_eisah7thuxa1eingaeLo').agenda_item
self.item_2.type = Item.AGENDA_ITEM