Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
908 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Generated by Django 2.2.17 on 2021-01-28 17:43 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("cases_tags", "0001_initial"), | ||
("cases", "0010_auto_20200327_0040"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="case", | ||
name="tags", | ||
field=models.ManyToManyField( | ||
blank=True, to="cases_tags.Tag", verbose_name="Tags" | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from django.contrib import admin | ||
from .models import Tag | ||
|
||
|
||
@admin.register(Tag) | ||
class TagAdmin(admin.ModelAdmin): | ||
pass | ||
list_display = [ | ||
"pk", | ||
"name", | ||
"monitoring", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class TagsConfig(AppConfig): | ||
name = "feder.cases_tags" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import factory | ||
|
||
from feder.monitorings.factories import MonitoringFactory | ||
from .models import Tag | ||
|
||
|
||
class TagFactory(factory.django.DjangoModelFactory): | ||
monitoring = factory.SubFactory(MonitoringFactory) | ||
name = factory.Sequence("tag-{}".format) | ||
|
||
class Meta: | ||
model = Tag | ||
|
||
|
||
class GlobalTagFactory(TagFactory): | ||
name = factory.Sequence("global-tag-{}".format) | ||
monitoring = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import django_filters | ||
|
||
from .models import Tag | ||
|
||
|
||
class TagFilter(django_filters.FilterSet): | ||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
self.filters["name"].lookup_expr = "icontains" | ||
|
||
class Meta: | ||
model = Tag | ||
fields = ["name"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from atom.ext.crispy_forms.forms import SingleButtonMixin | ||
from braces.forms import UserKwargModelFormMixin | ||
from django import forms | ||
from .models import Tag | ||
|
||
|
||
class TagForm(SingleButtonMixin, UserKwargModelFormMixin, forms.ModelForm): | ||
def __init__(self, *args, **kwargs): | ||
self.monitoring = kwargs.pop("monitoring", None) | ||
super().__init__(*args, **kwargs) | ||
if self.monitoring: | ||
self.instance.monitoring = self.monitoring | ||
|
||
class Meta: | ||
model = Tag | ||
fields = ["name"] |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# SOME DESCRIPTIVE TITLE. | ||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER | ||
# This file is distributed under the same license as the PACKAGE package. | ||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: \n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2021-01-29 00:43+0000\n" | ||
"PO-Revision-Date: 2021-01-29 01:44+0100\n" | ||
"Language: pl\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n" | ||
"%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n" | ||
"%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"X-Generator: Poedit 1.8.7.1\n" | ||
|
||
#: models.py:24 | ||
msgid "Keep blank to make global" | ||
msgstr "Pozostaw puste, aby uczynić globalnym" | ||
|
||
#: models.py:26 | ||
msgid "Name" | ||
msgstr "Nazwa" | ||
|
||
#: models.py:27 | ||
msgid "Slug" | ||
msgstr "Identyfikator redakcyjny" | ||
|
||
#: models.py:43 | ||
msgid "Tag" | ||
msgstr "Tag" | ||
|
||
#: models.py:44 | ||
msgid "Tags" | ||
msgstr "Tagi" | ||
|
||
#: templates/cases_tags/_btn.html:10 | ||
msgid "Edit" | ||
msgstr "Edytuj" | ||
|
||
#: templates/cases_tags/_btn.html:15 | ||
msgid "Delete" | ||
msgstr "Usuń" | ||
|
||
#: templates/cases_tags/_btn.html:20 | ||
msgid "Create" | ||
msgstr "Utwórz" | ||
|
||
#: templates/cases_tags/base_tag.html:13 templates/cases_tags/base_tag.html:24 | ||
msgid "Tags index" | ||
msgstr "Wykaz tagów" | ||
|
||
#: templates/cases_tags/tag_confirm_delete.html:9 | ||
msgid "Confirm delete" | ||
msgstr "Potwierdzenie usunięcia" | ||
|
||
#: templates/cases_tags/tag_form.html:24 | ||
msgid "Add tag" | ||
msgstr "Dodaj tag" | ||
|
||
#: urls.py:8 | ||
msgid "^monitoring-(?P<monitoring>[\\d]+)$" | ||
msgstr "^monitoring-(?P<monitoring>[\\d]+)$" | ||
|
||
#: urls.py:13 | ||
msgid "^monitoring-(?P<monitoring>[\\d]+)/~create$" | ||
msgstr "^monitoring-(?P<monitoring>[\\d]+)/~create$" | ||
|
||
#: urls.py:18 | ||
msgid "^monitoring-(?P<monitoring>[\\d]+)/~autocomplete$" | ||
msgstr "^monitoring-(?P<monitoring>[\\d]+)/~autocomplete$" | ||
|
||
#: urls.py:23 | ||
msgid "^monitoring-(?P<monitoring>[\\d]+)/(?P<pk>[\\d]+)$" | ||
msgstr "^monitoring-(?P<monitoring>[\\d]+)/(?P<pk>[\\d]+)$" | ||
|
||
#: urls.py:28 | ||
msgid "^monitoring-(?P<monitoring>[\\d]+)/(?P<pk>[\\d]+)/~update$" | ||
msgstr "^monitoring-(?P<monitoring>[\\d]+)/(?P<pk>[\\d]+)/~update$" | ||
|
||
#: urls.py:33 | ||
msgid "^monitoring-(?P<monitoring>[\\d]+)/(?P<pk>[\\d]+)/~delete$" | ||
msgstr "^monitoring-(?P<monitoring>[\\d]+)/(?P<pk>[\\d]+)/~delete$" | ||
|
||
#: views.py:29 | ||
msgid "Tag index" | ||
msgstr "Wykaz tagów" | ||
|
||
#: views.py:102 | ||
#, python-brace-format | ||
msgid "{object} deleted!" | ||
msgstr "{object} usunięty!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Generated by Django 2.2.17 on 2021-01-28 17:43 | ||
|
||
import autoslug.fields | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django.utils.timezone | ||
import model_utils.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
("monitorings", "0018_auto_20200711_2201"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Tag", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"created", | ||
model_utils.fields.AutoCreatedField( | ||
default=django.utils.timezone.now, | ||
editable=False, | ||
verbose_name="created", | ||
), | ||
), | ||
( | ||
"modified", | ||
model_utils.fields.AutoLastModifiedField( | ||
default=django.utils.timezone.now, | ||
editable=False, | ||
verbose_name="modified", | ||
), | ||
), | ||
( | ||
"name", | ||
models.CharField( | ||
db_index=True, max_length=250, unique=True, verbose_name="Name" | ||
), | ||
), | ||
( | ||
"slug", | ||
autoslug.fields.AutoSlugField( | ||
editable=False, populate_from="name", verbose_name="Slug" | ||
), | ||
), | ||
( | ||
"monitoring", | ||
models.ForeignKey( | ||
blank=True, | ||
help_text="Keep blank to make global", | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="monitorings.Monitoring", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "Tag", | ||
"verbose_name_plural": "Tags", | ||
"ordering": ["name"], | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 2.2.17 on 2021-01-29 00:52 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("monitorings", "0019_auto_20210128_2204"), | ||
("cases_tags", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="tag", | ||
name="name", | ||
field=models.CharField(db_index=True, max_length=250, verbose_name="Name"), | ||
), | ||
migrations.AlterUniqueTogether( | ||
name="tag", | ||
unique_together={("monitoring", "name")}, | ||
), | ||
] |
Empty file.
Oops, something went wrong.