-
Notifications
You must be signed in to change notification settings - Fork 47
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
57 changed files
with
1,750 additions
and
1,019 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
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,51 @@ | ||
from django.urls import path | ||
|
||
from . import reports | ||
|
||
TUTORIAL = [ | ||
("product-sales", reports.ProductSales), | ||
("total-product-sales", reports.TotalProductSales), | ||
("total-product-sales-by-country", reports.TotalProductSalesByCountry), | ||
("monthly-product-sales", reports.MonthlyProductSales), | ||
("product-sales-per-client-crosstab", reports.ProductSalesPerClientCrosstab), | ||
("product-sales-per-country-crosstab", reports.ProductSalesPerCountryCrosstab), | ||
("last-10-sales", reports.LastTenSales), | ||
("total-product-sales-with-custom-form", reports.TotalProductSalesWithCustomForm), | ||
|
||
] | ||
|
||
GROUP_BY = [ | ||
("group-by-report", reports.GroupByReport), | ||
("group-by-traversing-field", reports.GroupByTraversingFieldReport), | ||
("group-by-custom-queryset", reports.GroupByCustomQueryset), | ||
("no-group-by", reports.NoGroupByReport), | ||
] | ||
|
||
TIME_SERIES = [ | ||
("time-series-report", reports.TimeSeriesReport), | ||
("time-series-with-selector", reports.TimeSeriesReportWithSelector), | ||
("time-series-with-custom-dates", reports.TimeSeriesReportWithCustomDates), | ||
("time-series-with-custom-dates-and-title", reports.TimeSeriesReportWithCustomDatesAndCustomTitle), | ||
("time-series-without-group-by", reports.TimeSeriesWithoutGroupBy), | ||
('time-series-with-group-by-custom-queryset', reports.TimeSeriesReportWithCustomGroupByQueryset), | ||
] | ||
|
||
CROSSTAB = [ | ||
("crosstab-report", reports.CrosstabReport), | ||
("crosstab-report-with-ids", reports.CrosstabWithIds), | ||
("crosstab-report-traversing-field", reports.CrosstabWithTraversingField), | ||
("crosstab-report-custom-filter", reports.CrosstabWithIdsCustomFilter), | ||
("crosstab-report-custom-verbose-name", reports.CrossTabReportWithCustomVerboseName), | ||
("crosstab-report-custom-verbose-name-2", reports.CrossTabReportWithCustomVerboseNameCustomFilter), | ||
("crosstab-report-with-time-series", reports.CrossTabWithTimeSeries), | ||
|
||
] | ||
|
||
|
||
def get_urls_patterns(): | ||
urls = [] | ||
for name, report in TUTORIAL + GROUP_BY + TIME_SERIES + CROSSTAB: | ||
urls.append(path(f"{name}/", report.as_view(), name=name)) | ||
return urls | ||
|
||
|
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
24 changes: 24 additions & 0 deletions
24
demo_proj/demo_app/migrations/0004_client_country_product_sku.py
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,24 @@ | ||
# Generated by Django 4.2.4 on 2023-08-30 08:38 | ||
|
||
from django.db import migrations, models | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('demo_app', '0003_product_category'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='client', | ||
name='country', | ||
field=models.CharField(default='US', max_length=255, verbose_name='Country'), | ||
), | ||
migrations.AddField( | ||
model_name='product', | ||
name='sku', | ||
field=models.CharField(default=uuid.uuid4, max_length=255, verbose_name='SKU'), | ||
), | ||
] |
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,18 @@ | ||
# Generated by Django 4.2.4 on 2023-08-30 11:24 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('demo_app', '0004_client_country_product_sku'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='product', | ||
name='size', | ||
field=models.CharField(default='Medium', max_length=100, verbose_name='Product Category'), | ||
), | ||
] |
35 changes: 35 additions & 0 deletions
35
demo_proj/demo_app/migrations/0006_productcategory_remove_product_category_and_more.py
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,35 @@ | ||
# Generated by Django 4.2.4 on 2023-08-30 17:57 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('demo_app', '0005_product_size'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ProductCategory', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=100, verbose_name='Product Category Name')), | ||
], | ||
), | ||
migrations.RemoveField( | ||
model_name='product', | ||
name='category', | ||
), | ||
migrations.AlterField( | ||
model_name='product', | ||
name='size', | ||
field=models.CharField(default='Medium', max_length=100, verbose_name='Size'), | ||
), | ||
migrations.AddField( | ||
model_name='product', | ||
name='product_category', | ||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='demo_app.productcategory'), | ||
), | ||
] |
Oops, something went wrong.