Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charts #242

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6ad5594
Detailed versions of dependencies.
illa Sep 5, 2016
ede2316
Changed postgres to sqlite3.
illa Sep 5, 2016
3e29491
Added simple chart for report (type: column, x-axis: first column,
illa Sep 5, 2016
cab1994
Added chart with series.
illa Sep 6, 2016
6ea7d72
Added tab 'Chart options'.
illa Sep 6, 2016
fb20592
More options of chart: user can choose columns: categories, values, s…
illa Sep 6, 2016
c754e97
Added fields to Report model for storing columns for charts.
illa Sep 6, 2016
787687d
Saving chart infromation in database.
illa Sep 6, 2016
6188df3
Added 'chart_type' to Report model.
illa Sep 6, 2016
bf1fbde
Fixed displaying options in select elements. Fixed names of report pr…
illa Sep 6, 2016
ae990bd
Added exporting chart to image.
illa Sep 6, 2016
1eda9f4
Added availability of choosing style of chart (e.g. line, column,...).
illa Sep 7, 2016
6ba4be6
Added chart_style field to Report model.
illa Sep 7, 2016
4e0cc18
Added new chart options: stacked, labels and total.
illa Sep 8, 2016
b58f94e
Chart with series from few columns can be created.
illa Sep 9, 2016
f1f30d3
Added columns for series to 'Chart options' tab.
illa Sep 9, 2016
1af237e
Added saving many series columns indexes in database.
illa Sep 9, 2016
0f779e0
Added saving chart options: 'stacked', 'labels' and 'total'.
illa Sep 9, 2016
2cfd77d
Chart categories can be based on few columns now.
illa Sep 9, 2016
88b968a
Changes of charts_categories can be saved in database now.
illa Sep 10, 2016
3158f89
Chart with complex names of series can be created.
illa Sep 10, 2016
c1c9c8e
All tests pass.
illa Sep 11, 2016
a7466d8
Added file for gitlab ci.
illa Sep 12, 2016
ab909ba
Merge branch 'ci' into charts
illa Sep 12, 2016
0b81f0a
Added lint.
illa Sep 12, 2016
856ec70
Merge branch 'ci' into charts
illa Sep 12, 2016
a291bd5
Fixed code style.
illa Sep 12, 2016
fa6d75f
Fixed $scope.report undefined problem.
illa Sep 12, 2016
e24fbb6
If in some column 'total' is selected, chart will not show data from …
illa Sep 13, 2016
74c9d16
If in bar type chart there are many categories or series, chart will …
illa Sep 13, 2016
0bbcfb3
Fixed a little code style (semicolons).
illa Sep 15, 2016
a6e6559
Chart categories, series and values will be shown properly if user op…
illa Sep 16, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
image:
illa/for_splinter:v1

before_script:
- pip install celery
- pip install -r requirements.txt
- python setup.py develop
- pip install Django==1.8

tests:
script:
- python manage.py test

lint:
script:
- flake8
12 changes: 11 additions & 1 deletion report_builder/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ class Meta:
fields = (
'id', 'name', 'description', 'modified', 'root_model', 'root_model_name',
'displayfield_set', 'distinct', 'user_created', 'user_modified',
'filterfield_set', 'report_file', 'report_file_creation')
'filterfield_set', 'report_file', 'report_file_creation',
'chart_categories', 'chart_series', 'chart_values', 'chart_type', 'chart_style',
'chart_stacked', 'chart_labels', 'chart_total')
read_only_fields = ('report_file', 'report_file_creation')

def validate(self, data):
Expand All @@ -79,6 +81,14 @@ def update(self, instance, validated_data):

with transaction.atomic():
instance.name = validated_data.get('name', instance.name)
instance.chart_categories = validated_data.get('chart_categories', instance.chart_categories)
instance.chart_series = validated_data.get('chart_series', instance.chart_series)
instance.chart_values = validated_data.get('chart_values', instance.chart_values)
instance.chart_type = validated_data.get('chart_type', instance.chart_type)
instance.chart_style = validated_data.get('chart_style', instance.chart_style)
instance.chart_stacked = validated_data.get('chart_stacked', instance.chart_stacked)
instance.chart_labels = validated_data.get('chart_labels', instance.chart_labels)
instance.chart_total = validated_data.get('chart_total', instance.chart_total)
instance.description = validated_data.get('description', instance.description)
instance.distinct = validated_data.get(
'distinct', instance.distinct)
Expand Down
29 changes: 29 additions & 0 deletions report_builder/migrations/0004_auto_20160906_1149.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('report_builder', '0003_auto_20150720_1549'),
]

operations = [
migrations.AddField(
model_name='report',
name='chart_categories',
field=models.IntegerField(null=True, blank=True),
),
migrations.AddField(
model_name='report',
name='chart_series',
field=models.IntegerField(null=True, blank=True),
),
migrations.AddField(
model_name='report',
name='chart_values',
field=models.IntegerField(null=True, blank=True),
),
]
19 changes: 19 additions & 0 deletions report_builder/migrations/0005_report_chart_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('report_builder', '0004_auto_20160906_1149'),
]

operations = [
migrations.AddField(
model_name='report',
name='chart_type',
field=models.IntegerField(null=True, blank=True),
),
]
19 changes: 19 additions & 0 deletions report_builder/migrations/0006_report_chart_style.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('report_builder', '0005_report_chart_type'),
]

operations = [
migrations.AddField(
model_name='report',
name='chart_style',
field=models.CharField(max_length=16, null=True, blank=True),
),
]
19 changes: 19 additions & 0 deletions report_builder/migrations/0007_auto_20160909_0916.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('report_builder', '0006_report_chart_style'),
]

operations = [
migrations.AlterField(
model_name='report',
name='chart_values',
field=models.CommaSeparatedIntegerField(max_length=64, null=True, blank=True),
),
]
29 changes: 29 additions & 0 deletions report_builder/migrations/0008_auto_20160909_1231.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('report_builder', '0007_auto_20160909_0916'),
]

operations = [
migrations.AddField(
model_name='report',
name='chart_labels',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='report',
name='chart_stacked',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='report',
name='chart_total',
field=models.BooleanField(default=False),
),
]
19 changes: 19 additions & 0 deletions report_builder/migrations/0009_auto_20160910_0937.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('report_builder', '0008_auto_20160909_1231'),
]

operations = [
migrations.AlterField(
model_name='report',
name='chart_categories',
field=models.CommaSeparatedIntegerField(max_length=64, null=True, blank=True),
),
]
19 changes: 19 additions & 0 deletions report_builder/migrations/0010_auto_20160910_1037.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('report_builder', '0009_auto_20160910_0937'),
]

operations = [
migrations.AlterField(
model_name='report',
name='chart_series',
field=models.CommaSeparatedIntegerField(max_length=64, null=True, blank=True),
),
]
8 changes: 8 additions & 0 deletions report_builder/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ def allowed_models():
AUTH_USER_MODEL, blank=True,
help_text="These users have starred this report for easy reference.",
related_name="report_starred_set")
chart_style = models.CharField(max_length=16, null=True, blank=True)
chart_type = models.IntegerField(null=True, blank=True)
chart_categories = models.CommaSeparatedIntegerField(max_length=64, null=True, blank=True)
chart_series = models.CommaSeparatedIntegerField(max_length=64, null=True, blank=True)
chart_values = models.CommaSeparatedIntegerField(max_length=64, null=True, blank=True)
chart_stacked = models.BooleanField(default=False)
chart_labels = models.BooleanField(default=False)
chart_total = models.BooleanField(default=False)

def save(self, *args, **kwargs):
if not self.id:
Expand Down
Loading