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:
parent
fc22711a9c
commit
3c7d03547c
20
openslides/agenda/migrations/0003_auto_20160127_2136.py
Normal file
20
openslides/agenda/migrations/0003_auto_20160127_2136.py
Normal 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),
|
||||||
|
),
|
||||||
|
]
|
@ -233,7 +233,7 @@ class Item(RESTModelMixin, models.Model):
|
|||||||
The parent item in the agenda tree.
|
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.
|
Weight to sort the item in the agenda.
|
||||||
"""
|
"""
|
||||||
|
@ -99,7 +99,7 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
|
|||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
// open new dialog
|
// open new dialog
|
||||||
$scope.newDialog = function () {
|
$scope.newDialog = function () {
|
||||||
ngDialog.open({
|
ngDialog.open({
|
||||||
|
@ -244,6 +244,7 @@ class Numbering(TestCase):
|
|||||||
self.client.login(username='admin', password='admin')
|
self.client.login(username='admin', password='admin')
|
||||||
self.item_1 = CustomSlide.objects.create(title='test_title_thuha8eef7ohXar3eech').agenda_item
|
self.item_1 = CustomSlide.objects.create(title='test_title_thuha8eef7ohXar3eech').agenda_item
|
||||||
self.item_1.type = Item.AGENDA_ITEM
|
self.item_1.type = Item.AGENDA_ITEM
|
||||||
|
self.item_1.weight = 1
|
||||||
self.item_1.save()
|
self.item_1.save()
|
||||||
self.item_2 = CustomSlide.objects.create(title='test_title_eisah7thuxa1eingaeLo').agenda_item
|
self.item_2 = CustomSlide.objects.create(title='test_title_eisah7thuxa1eingaeLo').agenda_item
|
||||||
self.item_2.type = Item.AGENDA_ITEM
|
self.item_2.type = Item.AGENDA_ITEM
|
||||||
|
Loading…
Reference in New Issue
Block a user