Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
JoinTheCity
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rafal
JoinTheCity
Commits
aabde30d
Commit
aabde30d
authored
Jan 17, 2016
by
Rafal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change for data
parent
8728aaee
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
11 deletions
+3
-11
models.py
JoinTheCityREST/app/API/models.py
+1
-1
views.py
JoinTheCityREST/app/API/views.py
+2
-2
API.py
JoinTheCityREST/lib/api/API.py
+0
-6
apteki.py
JoinTheCityREST/lib/api/apteki.py
+0
-2
No files found.
JoinTheCityREST/app/API/models.py
View file @
aabde30d
...
...
@@ -17,7 +17,7 @@ class API(models.Model):
tag
=
models
.
ManyToManyField
(
Tag
,
related_name
=
'API_tags'
,
blank
=
False
,
default
=
None
)
type
=
models
.
ForeignKey
(
APIType
,
related_name
=
'API_type'
,
blank
=
False
,
null
=
False
,
default
=
None
)
source
=
models
.
CharField
(
max_length
=
100
)
source
=
models
.
CharField
(
max_length
=
100
00
)
icon
=
models
.
ImageField
(
null
=
True
,
blank
=
True
)
description
=
models
.
CharField
(
max_length
=
300
,
default
=
None
,
null
=
True
,
blank
=
True
)
...
...
JoinTheCityREST/app/API/views.py
View file @
aabde30d
...
...
@@ -56,8 +56,8 @@ class APIViewSet(viewsets.ModelViewSet):
del
(
r
[
'method'
])
self
.
request
.
GET
=
r
response
=
APIViewSet
.
test
(
self
.
request
,
self
.
kwargs
[
'pk'
],
method
)
#
queryset[0]['source'] = response
#
queryset[0].save()
queryset
[
0
][
'source'
]
=
response
queryset
[
0
]
.
save
()
print
queryset
#return queryset
return
queryset
...
...
JoinTheCityREST/lib/api/API.py
View file @
aabde30d
...
...
@@ -15,13 +15,7 @@ class BaseAPI(object):
def
GET
(
self
,
parameters
=
{}):
parameters
[
'resource'
]
=
self
.
resource
print
"WYSYLAM"
print
self
.
site
print
self
.
auth
print
parameters
print
self
.
verifySSL
r
=
requests
.
get
(
self
.
site
,
auth
=
self
.
auth
,
params
=
parameters
,
verify
=
self
.
verifySSL
)
print
r
.
status_code
if
r
.
status_code
==
200
:
return
r
.
json
()
return
False
...
...
JoinTheCityREST/lib/api/apteki.py
View file @
aabde30d
...
...
@@ -15,8 +15,6 @@ class API(BaseAPI):
def
object
(
self
):
data
=
self
.
GET
(
parameters
=
self
.
request
.
GET
.
dict
())
results
=
[]
print
'after'
print
data
try
:
for
obj
in
data
[
'results'
]:
results
.
append
(
self
.
unpack
(
obj
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment