Skip to content

Commit

Permalink
Merge branch 'a258001251842882_refactoring'
Browse files Browse the repository at this point in the history
  • Loading branch information
vmaksymiv committed Sep 12, 2017
2 parents b3d3473 + 7447c7a commit 19291c5
Show file tree
Hide file tree
Showing 18 changed files with 1,462 additions and 1,630 deletions.
2 changes: 1 addition & 1 deletion buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ auto-checkout = openprocurement.api
find-links = http://op:x9W3jZ@dist.quintagroup.com/op/

[sources]
openprocurement.api = git https://github.com/openprocurement/openprocurement.api.git branch=master
openprocurement.api = git https://github.com/openprocurement/openprocurement.api.git branch=a362908003690022_block_cpv_on_refactoring

[test]
recipe = zc.recipe.egg:scripts
Expand Down
34 changes: 17 additions & 17 deletions docs/source/tutorial/create-plan.http
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Host: api-sandbox.openprocurement.org
}
],
"deliveryDate": {
"endDate": "2017-07-05T12:41:41.857893"
"endDate": "2017-07-06T17:41:39.677983"
},
"unit": {
"code": "KGM",
Expand All @@ -50,7 +50,7 @@ Host: api-sandbox.openprocurement.org
}
],
"deliveryDate": {
"endDate": "2017-07-06T12:41:41.857893"
"endDate": "2017-07-07T17:41:39.677983"
},
"unit": {
"code": "KGM",
Expand All @@ -73,7 +73,7 @@ Host: api-sandbox.openprocurement.org
}
],
"deliveryDate": {
"endDate": "2017-07-07T12:41:41.857893"
"endDate": "2017-07-08T17:41:39.677983"
},
"unit": {
"code": "KGM",
Expand Down Expand Up @@ -112,18 +112,18 @@ Host: api-sandbox.openprocurement.org
"procurementMethod": "open",
"procurementMethodType": "belowThreshold",
"tenderPeriod": {
"startDate": "2017-06-27T12:41:41.857893"
"startDate": "2017-06-28T17:41:39.677983"
}
}
}
}

Response: 201 Created
Content-Type: application/json; charset=UTF-8
Location: http://api-sandbox.openprocurement.org/api/2.3/plans/b18f0d6638d64b4499666998e664977a
Location: http://api-sandbox.openprocurement.org/api/2.3/plans/52862ec099ff4debbf9f26a0980f27f3
{
"access": {
"token": "e1562366c516497d8154ff0237c55fce"
"token": "fc9c0f555bf24dffa2b855ed618bc81c"
},
"data": {
"classification": {
Expand All @@ -147,9 +147,9 @@ Location: http://api-sandbox.openprocurement.org/api/2.3/plans/b18f0d6638d64b449
}
],
"deliveryDate": {
"endDate": "2017-07-05T12:41:41.857893+03:00"
"endDate": "2017-07-06T17:41:39.677983+03:00"
},
"id": "aa20b36ad490439ab0d3d7f8673f8197",
"id": "f8173e5bf8754aec89a47a624b3cefd1",
"unit": {
"code": "KGM",
"name": "кг"
Expand All @@ -171,9 +171,9 @@ Location: http://api-sandbox.openprocurement.org/api/2.3/plans/b18f0d6638d64b449
}
],
"deliveryDate": {
"endDate": "2017-07-06T12:41:41.857893+03:00"
"endDate": "2017-07-07T17:41:39.677983+03:00"
},
"id": "a8f6f67f36e54f4f94df2e04d297d530",
"id": "3b0208637aa44a99b388a9b540533a1c",
"unit": {
"code": "KGM",
"name": "кг"
Expand All @@ -195,17 +195,17 @@ Location: http://api-sandbox.openprocurement.org/api/2.3/plans/b18f0d6638d64b449
}
],
"deliveryDate": {
"endDate": "2017-07-07T12:41:41.857893+03:00"
"endDate": "2017-07-08T17:41:39.677983+03:00"
},
"id": "8163a94be49b47b9a3daf01fad79a997",
"id": "7266c3c7b95246718021ab671207335e",
"unit": {
"code": "KGM",
"name": "кг"
},
"quantity": 3000
}
],
"planID": "UA-P-2017-06-20-000001",
"planID": "UA-P-2017-06-21-000001",
"budget": {
"amountNet": 12222.0,
"description": "budget_description",
Expand All @@ -217,12 +217,12 @@ Location: http://api-sandbox.openprocurement.org/api/2.3/plans/b18f0d6638d64b449
"amount": 10000.0,
"id": "12303111000-2"
},
"datePublished": "2017-06-20T12:41:42.541383+03:00",
"datePublished": "2017-06-21T17:41:40.564867+03:00",
"tender": {
"procurementMethod": "open",
"procurementMethodType": "belowThreshold",
"tenderPeriod": {
"startDate": "2017-06-27T12:41:41.857893+03:00"
"startDate": "2017-06-28T17:41:39.677983+03:00"
}
},
"additionalClassifications": [
Expand All @@ -241,8 +241,8 @@ Location: http://api-sandbox.openprocurement.org/api/2.3/plans/b18f0d6638d64b449
"name": "ДУС"
},
"owner": "broker",
"dateModified": "2017-06-20T12:41:42.560100+03:00",
"id": "b18f0d6638d64b4499666998e664977a"
"dateModified": "2017-06-21T17:41:40.588719+03:00",
"id": "52862ec099ff4debbf9f26a0980f27f3"
}
}

24 changes: 12 additions & 12 deletions docs/source/tutorial/example_plan.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GET /api/2.3/plans/b18f0d6638d64b4499666998e664977a HTTP/1.0
GET /api/2.3/plans/52862ec099ff4debbf9f26a0980f27f3 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: api-sandbox.openprocurement.org

Expand Down Expand Up @@ -27,9 +27,9 @@ Content-Type: application/json; charset=UTF-8
}
],
"deliveryDate": {
"endDate": "2017-07-05T12:41:41.857893+03:00"
"endDate": "2017-07-06T17:41:39.677983+03:00"
},
"id": "aa20b36ad490439ab0d3d7f8673f8197",
"id": "f8173e5bf8754aec89a47a624b3cefd1",
"unit": {
"code": "KGM",
"name": "кг"
Expand All @@ -51,9 +51,9 @@ Content-Type: application/json; charset=UTF-8
}
],
"deliveryDate": {
"endDate": "2017-07-06T12:41:41.857893+03:00"
"endDate": "2017-07-07T17:41:39.677983+03:00"
},
"id": "a8f6f67f36e54f4f94df2e04d297d530",
"id": "3b0208637aa44a99b388a9b540533a1c",
"unit": {
"code": "KGM",
"name": "кг"
Expand All @@ -75,17 +75,17 @@ Content-Type: application/json; charset=UTF-8
}
],
"deliveryDate": {
"endDate": "2017-07-07T12:41:41.857893+03:00"
"endDate": "2017-07-08T17:41:39.677983+03:00"
},
"id": "8163a94be49b47b9a3daf01fad79a997",
"id": "7266c3c7b95246718021ab671207335e",
"unit": {
"code": "KGM",
"name": "кг"
},
"quantity": 3000
}
],
"planID": "UA-P-2017-06-20-000001",
"planID": "UA-P-2017-06-21-000001",
"budget": {
"amountNet": 12222.0,
"description": "budget_description",
Expand All @@ -97,12 +97,12 @@ Content-Type: application/json; charset=UTF-8
"amount": 10000.0,
"id": "12303111000-2"
},
"datePublished": "2017-06-20T12:41:42.541383+03:00",
"datePublished": "2017-06-21T17:41:40.564867+03:00",
"tender": {
"procurementMethod": "open",
"procurementMethodType": "belowThreshold",
"tenderPeriod": {
"startDate": "2017-06-27T12:41:41.857893+03:00"
"startDate": "2017-06-28T17:41:39.677983+03:00"
}
},
"additionalClassifications": [
Expand All @@ -121,8 +121,8 @@ Content-Type: application/json; charset=UTF-8
"name": "ДУС"
},
"owner": "broker",
"dateModified": "2017-06-20T12:41:42.560100+03:00",
"id": "b18f0d6638d64b4499666998e664977a"
"dateModified": "2017-06-21T17:41:40.588719+03:00",
"id": "52862ec099ff4debbf9f26a0980f27f3"
}
}

14 changes: 7 additions & 7 deletions docs/source/tutorial/patch-plan-procuringEntity-name.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PATCH /api/2.3/plans/b18f0d6638d64b4499666998e664977a?acc_token=e1562366c516497d8154ff0237c55fce HTTP/1.0
PATCH /api/2.3/plans/52862ec099ff4debbf9f26a0980f27f3?acc_token=fc9c0f555bf24dffa2b855ed618bc81c HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 652
Content-Type: application/json
Expand Down Expand Up @@ -61,15 +61,15 @@ Content-Type: application/json; charset=UTF-8
"deliveryDate": {
"endDate": "2016-06-01T23:06:30.023018+03:00"
},
"id": "aa20b36ad490439ab0d3d7f8673f8197",
"id": "f8173e5bf8754aec89a47a624b3cefd1",
"unit": {
"code": "KGM",
"name": "кг"
},
"quantity": 5000
}
],
"planID": "UA-P-2017-06-20-000001",
"planID": "UA-P-2017-06-21-000001",
"budget": {
"amountNet": 12222.0,
"description": "budget_description",
Expand All @@ -81,12 +81,12 @@ Content-Type: application/json; charset=UTF-8
"amount": 10000.0,
"id": "12303111000-2"
},
"datePublished": "2017-06-20T12:41:42.541383+03:00",
"datePublished": "2017-06-21T17:41:40.564867+03:00",
"tender": {
"procurementMethod": "open",
"procurementMethodType": "belowThreshold",
"tenderPeriod": {
"startDate": "2017-06-27T12:41:41.857893+03:00"
"startDate": "2017-06-28T17:41:39.677983+03:00"
}
},
"additionalClassifications": [
Expand All @@ -105,8 +105,8 @@ Content-Type: application/json; charset=UTF-8
"name": "ДУС"
},
"owner": "broker",
"dateModified": "2017-06-20T12:41:42.740142+03:00",
"id": "b18f0d6638d64b4499666998e664977a"
"dateModified": "2017-06-21T17:41:40.747307+03:00",
"id": "52862ec099ff4debbf9f26a0980f27f3"
}
}

10 changes: 5 additions & 5 deletions docs/source/tutorial/plan-listing-after-patch.http
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Response: 200 OK
Content-Type: application/json; charset=UTF-8
{
"next_page": {
"path": "/api/2.3/plans?offset=2017-06-20T12%3A41%3A42.560100%2B03%3A00",
"uri": "http://api-sandbox.openprocurement.org/api/2.3/plans?offset=2017-06-20T12%3A41%3A42.560100%2B03%3A00",
"offset": "2017-06-20T12:41:42.560100+03:00"
"path": "/api/2.3/plans?offset=2017-06-21T17%3A41%3A40.588719%2B03%3A00",
"uri": "http://api-sandbox.openprocurement.org/api/2.3/plans?offset=2017-06-21T17%3A41%3A40.588719%2B03%3A00",
"offset": "2017-06-21T17:41:40.588719+03:00"
},
"data": [
{
"id": "b18f0d6638d64b4499666998e664977a",
"dateModified": "2017-06-20T12:41:42.560100+03:00"
"id": "52862ec099ff4debbf9f26a0980f27f3",
"dateModified": "2017-06-21T17:41:40.588719+03:00"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion openprocurement/planning/api/migration.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
import logging
from openprocurement.api.models import get_now
from openprocurement.api.utils import get_now
from openprocurement.planning.api.traversal import Root
from openprocurement.planning.api.models import Plan

Expand Down
5 changes: 3 additions & 2 deletions openprocurement/planning/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
from uuid import uuid4
from couchdb_schematics.document import SchematicsDocument
from schematics.exceptions import ValidationError
from openprocurement.api.utils import get_now
from openprocurement.api.models import Model, Period, Revision
from openprocurement.api.models import Document as BaseDocument
from openprocurement.api.models import Unit, CPVClassification, Classification, Identifier
from openprocurement.api.models import schematics_embedded_role, schematics_default_role, IsoDateTimeType, ListType
from openprocurement.api.models import validate_cpv_group, validate_items_uniq, validate_dkpp, get_now
from openprocurement.api.models import CPV_ITEMS_CLASS_FROM, ADDITIONAL_CLASSIFICATIONS_SCHEMES, ADDITIONAL_CLASSIFICATIONS_SCHEMES_2017
from openprocurement.api.validation import validate_cpv_group, validate_items_uniq
from openprocurement.api.constants import CPV_ITEMS_CLASS_FROM, ADDITIONAL_CLASSIFICATIONS_SCHEMES, ADDITIONAL_CLASSIFICATIONS_SCHEMES_2017
from pyramid.security import Allow
from schematics.transforms import whitelist, blacklist
from schematics.types import StringType, IntType, FloatType, BaseType
Expand Down
2 changes: 1 addition & 1 deletion openprocurement/planning/api/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from base64 import b64encode
from copy import deepcopy
from datetime import datetime, timedelta
from openprocurement.api.utils import VERSION, SESSION
from openprocurement.api.constants import VERSION, SESSION
from requests.models import Response
from urllib import urlencode
from uuid import uuid4
Expand Down

0 comments on commit 19291c5

Please sign in to comment.