-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #921 from linea-it/develop
v0.15.1
- Loading branch information
Showing
65 changed files
with
15,419 additions
and
810 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.9.4 on 2017-11-29 12:18 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('userquery', '0020_auto_20171116_1858'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='query', | ||
name='description', | ||
field=models.CharField(max_length=256, null=True, verbose_name='Description'), | ||
), | ||
] |
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,20 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.9.4 on 2017-11-29 12:23 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('userquery', '0021_auto_20171129_1218'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='query', | ||
name='description', | ||
field=models.CharField(blank=True, max_length=256, null=True, verbose_name='Description'), | ||
), | ||
] |
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,22 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.9.4 on 2017-11-30 17:21 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('product', '0081_cutoutjob_cjb_image_formats'), | ||
('userquery', '0022_auto_20171129_1223'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='table', | ||
name='product_id', | ||
field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='product_id', to='product.Product', verbose_name='Product'), | ||
), | ||
] |
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 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.9.4 on 2017-11-30 17:46 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('userquery', '0023_table_product_id'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='table', | ||
name='product_id', | ||
field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='product', to='product.Product', verbose_name='Product'), | ||
), | ||
] |
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,20 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.9.4 on 2017-11-30 17:57 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('userquery', '0024_auto_20171130_1746'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name='table', | ||
old_name='product_id', | ||
new_name='product', | ||
), | ||
] |
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import logging | ||
|
||
from product_register.ImportProcess import Import | ||
from product.models import Product | ||
from userquery.models import Table | ||
|
||
|
||
def register_table_in_the_target_viewer(user, table_pk, description=None): | ||
logger = logging.getLogger('register_table_in_the_target_viewer') | ||
logger.info("Register the new table as a product") | ||
|
||
table = Table.objects.get(pk=table_pk) | ||
|
||
# Dados para o registro | ||
data = list([{ | ||
"process_id": None, | ||
"name": table.table_name, | ||
"display_name": table.display_name, | ||
"database": 'catalog', | ||
"schema": table.schema, | ||
"table": table.table_name, | ||
"filter": [], | ||
# review | ||
"releases": [], | ||
"fields": [], | ||
"association": [], | ||
"type": "catalog", | ||
"class": "objects", | ||
"description": description | ||
}]) | ||
|
||
logger.debug("Register Data") | ||
logger.debug(data) | ||
|
||
# Registar o novo produto | ||
import_product = Import() | ||
|
||
import_product.user = user | ||
import_product.owner = user | ||
import_product.site = None | ||
import_product.process = None | ||
|
||
import_product.import_products(data) | ||
|
||
product = Product.objects.get( | ||
prd_display_name=table.display_name, | ||
table__tbl_name=table.table_name, | ||
table__tbl_schema=table.schema, | ||
table__tbl_database='catalog' | ||
) | ||
|
||
table.product = product | ||
table.save() | ||
|
||
logger.info("New Product -id %s- was Registered" % product.pk) |
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
Oops, something went wrong.