Merge pull request #485 from taigaio/allowing-date-field-type
Fix custom attributesremotes/origin/logger
commit
e2000db8ee
|
@ -4,7 +4,7 @@
|
|||
## 1.9.0 ??? (unreleased)
|
||||
|
||||
### Features
|
||||
- Add a "field type" property for custom fields: 'text' and 'multiline text' right now (thanks to [@artlepool](https://github.com/artlepool)).
|
||||
- Add a "field type" property for custom fields: 'text', 'multiline text' and 'date' right now (thanks to [@artlepool](https://github.com/artlepool)).
|
||||
- Allow multiple actions in the commit messages.
|
||||
- Now every user that coments USs, Issues or Tasks will be involved in it (add author to the watchers list).
|
||||
- Fix the compatibility with BitBucket webhooks and add issues and issues comments integration.
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
# Copyright (C) 2014-2015 Andrey Antukh <niwi@niwi.be>
|
||||
# Copyright (C) 2014-2015 Jesús Espino <jespinog@gmail.com>
|
||||
# Copyright (C) 2014-2015 David Barragán <bameda@dbarragan.com>
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
TEXT_TYPE = "text"
|
||||
MULTILINE_TYPE = "multiline"
|
||||
DATE_TYPE = "date"
|
||||
|
||||
TYPES_CHOICES = (
|
||||
(TEXT_TYPE, _("Text")),
|
||||
(MULTILINE_TYPE, _("Multi-Line Text")),
|
||||
(DATE_TYPE, _("Date"))
|
||||
)
|
|
@ -1,32 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('custom_attributes', '0005_auto_20150505_1639'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='issuecustomattribute',
|
||||
name='field_type',
|
||||
field=models.CharField(max_length=5, verbose_name='type', choices=[('TEXT', 'Text'), ('MULTI', 'Multi-Line Text')], default='TEXT'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='taskcustomattribute',
|
||||
name='field_type',
|
||||
field=models.CharField(max_length=5, verbose_name='type', choices=[('TEXT', 'Text'), ('MULTI', 'Multi-Line Text')], default='TEXT'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='userstorycustomattribute',
|
||||
name='field_type',
|
||||
field=models.CharField(max_length=5, verbose_name='type', choices=[('TEXT', 'Text'), ('MULTI', 'Multi-Line Text')], default='TEXT'),
|
||||
preserve_default=True,
|
||||
),
|
||||
]
|
|
@ -0,0 +1,29 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('custom_attributes', '0005_auto_20150505_1639'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='issuecustomattribute',
|
||||
name='type',
|
||||
field=models.CharField(default='text', choices=[('text', 'Text'), ('multiline', 'Multi-Line Text'), ('date', 'Date')], verbose_name='type', max_length=16),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='taskcustomattribute',
|
||||
name='type',
|
||||
field=models.CharField(default='text', choices=[('text', 'Text'), ('multiline', 'Multi-Line Text'), ('date', 'Date')], verbose_name='type', max_length=16),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='userstorycustomattribute',
|
||||
name='type',
|
||||
field=models.CharField(default='text', choices=[('text', 'Text'), ('multiline', 'Multi-Line Text'), ('date', 'Date')], verbose_name='type', max_length=16),
|
||||
),
|
||||
]
|
|
@ -22,6 +22,8 @@ from django_pgjson.fields import JsonField
|
|||
|
||||
from taiga.projects.occ.mixins import OCCModelMixin
|
||||
|
||||
from . import choices
|
||||
|
||||
|
||||
######################################################
|
||||
# Custom Attribute Models
|
||||
|
@ -29,13 +31,11 @@ from taiga.projects.occ.mixins import OCCModelMixin
|
|||
|
||||
|
||||
class AbstractCustomAttribute(models.Model):
|
||||
FIELD_TYPES = (
|
||||
("TEXT", _("Text")),
|
||||
("MULTI", _("Multi-Line Text"))
|
||||
)
|
||||
name = models.CharField(null=False, blank=False, max_length=64, verbose_name=_("name"))
|
||||
description = models.TextField(null=False, blank=True, verbose_name=_("description"))
|
||||
field_type = models.CharField(null=False, blank=False, choices=FIELD_TYPES, max_length=5, default="TEXT", verbose_name=_("type"))
|
||||
type = models.CharField(null=False, blank=False, max_length=16,
|
||||
choices=choices.TYPES_CHOICES, default=choices.TEXT_TYPE,
|
||||
verbose_name=_("type"))
|
||||
order = models.IntegerField(null=False, blank=False, default=10000, verbose_name=_("order"))
|
||||
project = models.ForeignKey("projects.Project", null=False, blank=False, related_name="%(class)ss",
|
||||
verbose_name=_("project"))
|
||||
|
|
Loading…
Reference in New Issue