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
0e50a5a6
Commit
0e50a5a6
authored
Jan 10, 2016
by
Eryk Leniart
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gitlab.telemabk.pl/vallher/JoinTheCity
parents
7514fbaf
86e0c0b4
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
205 additions
and
14 deletions
+205
-14
urls.py
JoinTheCityREST/JoinTheCityREST/urls.py
+4
-0
admin.py
JoinTheCityREST/app/API/admin.py
+3
-0
admin.py
JoinTheCityREST/app/Discussion/admin.py
+4
-0
models.py
JoinTheCityREST/app/Discussion/models.py
+3
-1
serializers.py
JoinTheCityREST/app/Discussion/serializers.py
+1
-1
admin.py
JoinTheCityREST/app/Event/admin.py
+3
-0
admin.py
JoinTheCityREST/app/Friendship/admin.py
+3
-0
admin.py
JoinTheCityREST/app/Localization/admin.py
+3
-0
__init__.py
JoinTheCityREST/app/Localization/management/__init__.py
+1
-0
__init__.py
...CityREST/app/Localization/management/commands/__init__.py
+1
-0
init_localizations.py
...pp/Localization/management/commands/init_localizations.py
+24
-0
models.py
JoinTheCityREST/app/Localization/models.py
+1
-0
serializers.py
JoinTheCityREST/app/Localization/serializers.py
+1
-1
admin.py
JoinTheCityREST/app/Tag/admin.py
+3
-0
views.py
JoinTheCityREST/app/Tag/views.py
+66
-2
admin.py
JoinTheCityREST/app/User/admin.py
+7
-0
__init__.py
JoinTheCityREST/app/User/management/__init__.py
+1
-0
__init__.py
JoinTheCityREST/app/User/management/commands/__init__.py
+1
-0
init.py
JoinTheCityREST/app/User/management/commands/init.py
+14
-0
init_users.py
JoinTheCityREST/app/User/management/commands/init_users.py
+24
-0
API.py
JoinTheCityREST/lib/api/API.py
+1
-1
apteki.py
JoinTheCityREST/lib/api/apteki.py
+24
-2
baseny.py
JoinTheCityREST/lib/api/baseny.py
+2
-1
hotele.py
JoinTheCityREST/lib/api/hotele.py
+2
-1
mapaUtrudnien.py
JoinTheCityREST/lib/api/mapaUtrudnien.py
+2
-1
restauracje.py
JoinTheCityREST/lib/api/restauracje.py
+2
-1
szpitale.py
JoinTheCityREST/lib/api/szpitale.py
+2
-1
zdarzeniaDrogowe.py
JoinTheCityREST/lib/api/zdarzeniaDrogowe.py
+2
-1
No files found.
JoinTheCityREST/JoinTheCityREST/urls.py
View file @
0e50a5a6
...
@@ -25,6 +25,10 @@ router.register(r'user_friendship', user_views.UserFriendshipViewSet)
...
@@ -25,6 +25,10 @@ router.register(r'user_friendship', user_views.UserFriendshipViewSet)
router
.
register
(
r'user_event_request'
,
user_views
.
UserEventRequestViewSet
)
router
.
register
(
r'user_event_request'
,
user_views
.
UserEventRequestViewSet
)
router
.
register
(
r'user_event'
,
user_views
.
UserEventViewSet
)
router
.
register
(
r'user_event'
,
user_views
.
UserEventViewSet
)
router
.
register
(
r'user_api'
,
user_views
.
UserAPIViewSet
)
router
.
register
(
r'user_api'
,
user_views
.
UserAPIViewSet
)
router
.
register
(
r'tag_api'
,
tag_views
.
TagApiViewSet
,
base_name
=
"tag_api"
)
router
.
register
(
r'tag_event'
,
tag_views
.
TagEventViewSet
,
base_name
=
"tag_event"
)
router
.
register
(
r'tag_discussion'
,
tag_views
.
TagDiscussionViewSet
,
base_name
=
"tag_discussion"
)
urlpatterns
=
patterns
(
''
,
urlpatterns
=
patterns
(
''
,
...
...
JoinTheCityREST/app/API/admin.py
View file @
0e50a5a6
from
django.contrib
import
admin
from
django.contrib
import
admin
# Register your models here.
# Register your models here.
from
app.API.models
import
API
admin
.
site
.
register
(
API
)
\ No newline at end of file
JoinTheCityREST/app/Discussion/admin.py
View file @
0e50a5a6
from
django.contrib
import
admin
from
django.contrib
import
admin
# Register your models here.
# Register your models here.
from
app.Discussion.models
import
TextMessage
,
Discussion
admin
.
site
.
register
(
TextMessage
)
admin
.
site
.
register
(
Discussion
)
\ No newline at end of file
JoinTheCityREST/app/Discussion/models.py
View file @
0e50a5a6
...
@@ -14,6 +14,8 @@ class TextMessage(models.Model):
...
@@ -14,6 +14,8 @@ class TextMessage(models.Model):
return
self
.
text
return
self
.
text
class
Discussion
(
models
.
Model
):
class
Discussion
(
models
.
Model
):
user
=
models
.
ForeignKey
(
User
,
related_name
=
'user_creator_of_discussion'
,
blank
=
False
,
null
=
False
,
default
=
None
)
question
=
models
.
CharField
(
max_length
=
100
)
question
=
models
.
CharField
(
max_length
=
100
)
message
=
models
.
ManyToManyField
(
TextMessage
,
blank
=
True
,
null
=
True
,
related_name
=
"conversations_participant"
)
message
=
models
.
ManyToManyField
(
TextMessage
,
blank
=
True
,
null
=
True
,
related_name
=
"conversations_participant"
)
tag
=
models
.
ForeignKey
(
Tag
,
related_name
=
'place_of_discussion'
,
blank
=
False
,
null
=
False
,
default
=
None
)
tag
=
models
.
ForeignKey
(
Tag
,
related_name
=
'place_of_discussion'
,
blank
=
False
,
null
=
False
,
default
=
None
)
...
...
JoinTheCityREST/app/Discussion/serializers.py
View file @
0e50a5a6
...
@@ -6,7 +6,7 @@ from app.User.serializers import UserSerializer
...
@@ -6,7 +6,7 @@ from app.User.serializers import UserSerializer
class
DiscussionSerializer
(
serializers
.
HyperlinkedModelSerializer
):
class
DiscussionSerializer
(
serializers
.
HyperlinkedModelSerializer
):
class
Meta
:
class
Meta
:
model
=
Discussion
model
=
Discussion
fields
=
(
'url'
,
'question'
,
'message'
,
'tag'
)
fields
=
(
'url'
,
'
user'
,
'
question'
,
'message'
,
'tag'
)
class
TextMessageSerializer
(
serializers
.
HyperlinkedModelSerializer
):
class
TextMessageSerializer
(
serializers
.
HyperlinkedModelSerializer
):
class
Meta
:
class
Meta
:
...
...
JoinTheCityREST/app/Event/admin.py
View file @
0e50a5a6
from
django.contrib
import
admin
from
django.contrib
import
admin
# Register your models here.
# Register your models here.
from
app.Event.models
import
Event
admin
.
site
.
register
(
Event
)
\ No newline at end of file
JoinTheCityREST/app/Friendship/admin.py
View file @
0e50a5a6
from
django.contrib
import
admin
from
django.contrib
import
admin
# Register your models here.
# Register your models here.
from
app.Friendship.models
import
FriendshipRequest
admin
.
site
.
register
(
FriendshipRequest
)
\ No newline at end of file
JoinTheCityREST/app/Localization/admin.py
View file @
0e50a5a6
from
django.contrib
import
admin
from
django.contrib
import
admin
# Register your models here.
# Register your models here.
from
app.Localization.models
import
Localization
admin
.
site
.
register
(
Localization
)
JoinTheCityREST/app/Localization/management/__init__.py
0 → 100644
View file @
0e50a5a6
__author__
=
'Rafal'
JoinTheCityREST/app/Localization/management/commands/__init__.py
0 → 100644
View file @
0e50a5a6
__author__
=
'Rafal'
JoinTheCityREST/app/Localization/management/commands/init_localizations.py
0 → 100644
View file @
0e50a5a6
from
django.contrib.auth.models
import
User
from
app.Localization.models
import
Localization
__author__
=
'Rafal'
from
django.core.management.base
import
BaseCommand
,
CommandError
class
Command
(
BaseCommand
):
help
=
'Closes the specified poll for voting'
def
add_arguments
(
self
,
parser
):
parser
.
add_argument
(
'poll_id'
,
nargs
=
'+'
,
type
=
int
)
def
handle
(
self
,
*
args
,
**
options
):
localizations
=
[
[
'Krakow'
,
'52.025459'
,
'19.204102'
,
'1000'
],
[
'Miasteczko AGH'
,
'50.0679444'
,
'19.9028223'
,
'40'
],
[
'Nowa Huta'
,
'50.0752396'
,
'20.0729312'
,
'200'
],
[
'Swiat'
,
'0'
,
'0'
,
'99999999999999'
]
]
print
"Creating Localizations"
for
localization
in
localizations
:
print
"Create {0}"
.
format
(
localization
[
0
])
new_localization
=
Localization
.
objects
.
create
(
name
=
localization
[
0
],
longitude
=
localization
[
1
],
latitude
=
localization
[
2
],
range
=
localization
[
3
])
new_localization
.
save
()
\ No newline at end of file
JoinTheCityREST/app/Localization/models.py
View file @
0e50a5a6
...
@@ -7,6 +7,7 @@ class Localization(models.Model):
...
@@ -7,6 +7,7 @@ class Localization(models.Model):
name
=
models
.
CharField
(
max_length
=
300
)
name
=
models
.
CharField
(
max_length
=
300
)
longitude
=
models
.
DecimalField
(
max_digits
=
9
,
decimal_places
=
6
,
default
=
None
)
longitude
=
models
.
DecimalField
(
max_digits
=
9
,
decimal_places
=
6
,
default
=
None
)
latitude
=
models
.
DecimalField
(
max_digits
=
9
,
decimal_places
=
6
,
default
=
None
)
latitude
=
models
.
DecimalField
(
max_digits
=
9
,
decimal_places
=
6
,
default
=
None
)
range
=
models
.
IntegerField
(
default
=
None
)
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
name
return
self
.
name
\ No newline at end of file
JoinTheCityREST/app/Localization/serializers.py
View file @
0e50a5a6
...
@@ -5,5 +5,5 @@ from app.Localization.models import Localization
...
@@ -5,5 +5,5 @@ from app.Localization.models import Localization
class
LocalizationSerializer
(
serializers
.
HyperlinkedModelSerializer
):
class
LocalizationSerializer
(
serializers
.
HyperlinkedModelSerializer
):
class
Meta
:
class
Meta
:
model
=
Localization
model
=
Localization
fields
=
(
'url'
,
'name'
,
'longitude'
,
'latitude'
)
fields
=
(
'url'
,
'name'
,
'longitude'
,
'latitude'
,
'range'
)
JoinTheCityREST/app/Tag/admin.py
View file @
0e50a5a6
from
django.contrib
import
admin
from
django.contrib
import
admin
# Register your models here.
# Register your models here.
from
app.Tag.models
import
Tag
admin
.
site
.
register
(
Tag
)
JoinTheCityREST/app/Tag/views.py
View file @
0e50a5a6
from
rest_framework
import
viewsets
,
permissions
from
rest_framework
import
viewsets
,
permissions
from
app.API.models
import
API
from
app.API.serializers
import
APISerializer
from
app.Discussion.models
import
Discussion
from
app.Discussion.serializers
import
DiscussionSerializer
from
app.Event.models
import
Event
from
app.Event.serializers
import
EventSerializer
from
app.Tag.models
import
Tag
from
app.Tag.models
import
Tag
from
app.Tag.serializers
import
TagSerializer
from
app.Tag.serializers
import
TagSerializer
from
django.shortcuts
import
get_object_or_404
import
rest_framework
from
rest_framework.response
import
Response
class
TagViewSet
(
viewsets
.
ModelViewSet
):
class
TagViewSet
(
viewsets
.
ModelViewSet
):
"""
"""
...
@@ -10,3 +18,59 @@ class TagViewSet(viewsets.ModelViewSet):
...
@@ -10,3 +18,59 @@ class TagViewSet(viewsets.ModelViewSet):
queryset
=
Tag
.
objects
.
all
()
queryset
=
Tag
.
objects
.
all
()
serializer_class
=
TagSerializer
serializer_class
=
TagSerializer
permission_classes
=
(
permissions
.
IsAuthenticatedOrReadOnly
,)
permission_classes
=
(
permissions
.
IsAuthenticatedOrReadOnly
,)
class
TagApiViewSet
(
viewsets
.
ModelViewSet
):
"""
API for articles
"""
queryset
=
Tag
.
objects
.
all
()
serializer_class
=
TagSerializer
permission_classes
=
(
permissions
.
IsAuthenticatedOrReadOnly
,)
def
list
(
self
,
request
,
*
args
,
**
kwargs
):
return
Response
(
status
=
rest_framework
.
status
.
HTTP_400_BAD_REQUEST
,
data
=
{
"Request name of tag! Provide it by '../tag_name/"
})
def
retrieve
(
self
,
request
,
pk
):
tag
=
get_object_or_404
(
self
.
queryset
,
name__iexact
=
pk
)
queryset
=
API
.
objects
.
filter
(
tag
=
tag
)
page
=
self
.
paginate_queryset
(
queryset
)
serializer
=
APISerializer
(
page
,
many
=
True
,
context
=
{
'request'
:
request
})
return
self
.
get_paginated_response
(
serializer
.
data
)
class
TagEventViewSet
(
viewsets
.
ModelViewSet
):
"""
API for articles
"""
queryset
=
Tag
.
objects
.
all
()
serializer_class
=
TagSerializer
permission_classes
=
(
permissions
.
IsAuthenticatedOrReadOnly
,)
def
list
(
self
,
request
,
*
args
,
**
kwargs
):
return
Response
(
status
=
rest_framework
.
status
.
HTTP_400_BAD_REQUEST
,
data
=
{
"Request name of tag! Provide it by '../tag_name/"
})
def
retrieve
(
self
,
request
,
pk
):
tag
=
get_object_or_404
(
self
.
queryset
,
name__iexact
=
pk
)
queryset
=
Event
.
objects
.
filter
(
tag
=
tag
)
page
=
self
.
paginate_queryset
(
queryset
)
serializer
=
EventSerializer
(
page
,
many
=
True
,
context
=
{
'request'
:
request
})
return
self
.
get_paginated_response
(
serializer
.
data
)
class
TagDiscussionViewSet
(
viewsets
.
ModelViewSet
):
"""
API for articles
"""
queryset
=
Tag
.
objects
.
all
()
serializer_class
=
TagSerializer
permission_classes
=
(
permissions
.
IsAuthenticatedOrReadOnly
,)
def
list
(
self
,
request
,
*
args
,
**
kwargs
):
return
Response
(
status
=
rest_framework
.
status
.
HTTP_400_BAD_REQUEST
,
data
=
{
"Request name of tag! Provide it by '../tag_name/"
})
def
retrieve
(
self
,
request
,
pk
):
tag
=
get_object_or_404
(
self
.
queryset
,
name__iexact
=
pk
)
queryset
=
Discussion
.
objects
.
filter
(
tag
=
tag
)
page
=
self
.
paginate_queryset
(
queryset
)
serializer
=
DiscussionSerializer
(
page
,
many
=
True
,
context
=
{
'request'
:
request
})
return
self
.
get_paginated_response
(
serializer
.
data
)
\ No newline at end of file
JoinTheCityREST/app/User/admin.py
View file @
0e50a5a6
from
django.contrib
import
admin
from
django.contrib
import
admin
# Register your models here.
# Register your models here.
from
app.User.models
import
UserEventRequest
,
UserAPI
,
UserFriendship
from
app.User.models
import
UserEvent
admin
.
site
.
register
(
UserFriendship
)
admin
.
site
.
register
(
UserAPI
)
admin
.
site
.
register
(
UserEvent
)
admin
.
site
.
register
(
UserEventRequest
)
\ No newline at end of file
JoinTheCityREST/app/User/management/__init__.py
0 → 100644
View file @
0e50a5a6
__author__
=
'Rafal'
JoinTheCityREST/app/User/management/commands/__init__.py
0 → 100644
View file @
0e50a5a6
__author__
=
'Rafal'
JoinTheCityREST/app/User/management/commands/init.py
0 → 100644
View file @
0e50a5a6
from
django.contrib.auth.models
import
User
from
django.core.management
import
call_command
__author__
=
'Rafal'
from
django.core.management.base
import
BaseCommand
,
CommandError
class
Command
(
BaseCommand
):
help
=
'Closes the specified poll for voting'
def
add_arguments
(
self
,
parser
):
parser
.
add_argument
(
'poll_id'
,
nargs
=
'+'
,
type
=
int
)
def
handle
(
self
,
*
args
,
**
options
):
call_command
(
'init_users'
)
call_command
(
'init_localizations'
)
\ No newline at end of file
JoinTheCityREST/app/User/management/commands/init_users.py
0 → 100644
View file @
0e50a5a6
from
django.contrib.auth.models
import
User
__author__
=
'Rafal'
from
django.core.management.base
import
BaseCommand
,
CommandError
class
Command
(
BaseCommand
):
help
=
'Closes the specified poll for voting'
def
add_arguments
(
self
,
parser
):
parser
.
add_argument
(
'poll_id'
,
nargs
=
'+'
,
type
=
int
)
def
handle
(
self
,
*
args
,
**
options
):
users
=
[
[
'admin'
,
'admin'
,
'admin@gmail.com'
,
],
[
'Antek'
,
'Antek'
,
'antek@gmail.com'
],
[
'Rafal'
,
'Rafal'
,
'rafal@gmail.com'
],
[
'Klaudia'
,
'Klaudia'
,
'klaudia@gmail.com'
]
]
print
"Creating Users"
for
user
in
users
:
print
"Create {0}"
.
format
(
user
[
0
])
new_user
=
User
.
objects
.
create
(
username
=
user
[
0
],
password
=
user
[
1
],
email
=
user
[
2
],
is_active
=
True
,
is_superuser
=
True
,
is_staff
=
True
,)
new_user
.
set_password
(
user
[
1
])
new_user
.
save
()
\ No newline at end of file
JoinTheCityREST/lib/api/API.py
View file @
0e50a5a6
...
@@ -17,7 +17,7 @@ class BaseAPI(object):
...
@@ -17,7 +17,7 @@ class BaseAPI(object):
parameters
[
'resource'
]
=
self
.
resource
parameters
[
'resource'
]
=
self
.
resource
r
=
requests
.
get
(
self
.
site
,
auth
=
self
.
auth
,
params
=
parameters
,
verify
=
self
.
verifySSL
)
r
=
requests
.
get
(
self
.
site
,
auth
=
self
.
auth
,
params
=
parameters
,
verify
=
self
.
verifySSL
)
if
r
.
status_code
==
200
:
if
r
.
status_code
==
200
:
return
json
.
dumps
(
r
.
json
()
)
return
r
.
json
(
)
return
False
return
False
def
execute
(
self
,
method
):
def
execute
(
self
,
method
):
...
...
JoinTheCityREST/lib/api/apteki.py
View file @
0e50a5a6
import
json
from
app.API.serializers
import
APISerializer
from
app.API.serializers
import
APISerializer
from
lib.api.API
import
BaseAPI
from
lib.api.API
import
BaseAPI
...
@@ -6,7 +7,28 @@ __author__ = 'Dominik Rosiek'
...
@@ -6,7 +7,28 @@ __author__ = 'Dominik Rosiek'
class
API
(
BaseAPI
):
class
API
(
BaseAPI
):
resource
=
"d5629ae6-3450-44fb-becb-4a418f354145"
resource
=
"d5629ae6-3450-44fb-becb-4a418f354145"
site
=
"https://api.bihapi.pl/dane/krakow"
site
=
"https://api.bihapi.pl/dane/krakow"
methods
=
(
'default'
)
methods
=
(
'default'
,
'object'
)
def
default
(
self
):
def
default
(
self
):
return
self
.
GET
(
parameters
=
self
.
request
.
GET
.
dict
())
return
json
.
dumps
(
self
.
GET
(
parameters
=
self
.
request
.
GET
.
dict
()))
def
object
(
self
):
data
=
self
.
GET
(
parameters
=
self
.
request
.
GET
.
dict
())
results
=
[]
try
:
for
obj
in
data
[
'results'
]:
results
.
append
(
self
.
unpack
(
obj
))
except
TypeError
as
e
:
results
.
append
(
self
.
unpack
(
data
[
'results'
]))
return
json
.
dumps
(
results
)
def
unpack
(
self
,
obj
):
result
=
{}
for
property
in
obj
[
'properties'
]:
if
property
[
'key'
]
==
'APTEKI'
:
result
[
'name'
]
=
property
[
'value'
]
elif
property
[
'key'
]
==
'OADR_GPS_S'
:
result
[
'latitude'
]
=
property
[
'value'
]
elif
property
[
'key'
]
==
'OADR_GPS_D'
:
result
[
'longitude'
]
=
property
[
'value'
]
return
result
JoinTheCityREST/lib/api/baseny.py
View file @
0e50a5a6
import
json
from
app.API.serializers
import
APISerializer
from
app.API.serializers
import
APISerializer
from
lib.api.API
import
BaseAPI
from
lib.api.API
import
BaseAPI
...
@@ -9,4 +10,4 @@ class API(BaseAPI):
...
@@ -9,4 +10,4 @@ class API(BaseAPI):
methods
=
(
'default'
)
methods
=
(
'default'
)
def
default
(
self
):
def
default
(
self
):
return
self
.
GET
(
parameters
=
self
.
request
.
GET
.
dict
(
))
return
json
.
dumps
(
self
.
GET
(
parameters
=
self
.
request
.
GET
.
dict
()
))
JoinTheCityREST/lib/api/hotele.py
View file @
0e50a5a6
import
json
from
app.API.serializers
import
APISerializer
from
app.API.serializers
import
APISerializer
from
lib.api.API
import
BaseAPI
from
lib.api.API
import
BaseAPI
...
@@ -9,4 +10,4 @@ class API(BaseAPI):
...
@@ -9,4 +10,4 @@ class API(BaseAPI):
methods
=
(
'default'
)
methods
=
(
'default'
)
def
default
(
self
):
def
default
(
self
):
return
self
.
GET
(
parameters
=
self
.
request
.
GET
.
dict
(
))
return
json
.
dumps
(
self
.
GET
(
parameters
=
self
.
request
.
GET
.
dict
()
))
JoinTheCityREST/lib/api/mapaUtrudnien.py
View file @
0e50a5a6
import
json
from
app.API.serializers
import
APISerializer
from
app.API.serializers
import
APISerializer
from
lib.api.API
import
BaseAPI
from
lib.api.API
import
BaseAPI
...
@@ -9,4 +10,4 @@ class API(BaseAPI):
...
@@ -9,4 +10,4 @@ class API(BaseAPI):
methods
=
(
'default'
)
methods
=
(
'default'
)
def
default
(
self
):
def
default
(
self
):
return
self
.
GET
(
parameters
=
self
.
request
.
GET
.
dict
(
))
return
json
.
dumps
(
self
.
GET
(
parameters
=
self
.
request
.
GET
.
dict
()
))
JoinTheCityREST/lib/api/restauracje.py
View file @
0e50a5a6
import
json
from
app.API.serializers
import
APISerializer
from
app.API.serializers
import
APISerializer
from
lib.api.API
import
BaseAPI
from
lib.api.API
import
BaseAPI
...
@@ -9,4 +10,4 @@ class API(BaseAPI):
...
@@ -9,4 +10,4 @@ class API(BaseAPI):
methods
=
(
'default'
)
methods
=
(
'default'
)
def
default
(
self
):
def
default
(
self
):
return
self
.
GET
(
parameters
=
self
.
request
.
GET
.
dict
(
))
return
json
.
dumps
(
self
.
GET
(
parameters
=
self
.
request
.
GET
.
dict
()
))
JoinTheCityREST/lib/api/szpitale.py
View file @
0e50a5a6
import
json
from
app.API.serializers
import
APISerializer
from
app.API.serializers
import
APISerializer
from
lib.api.API
import
BaseAPI
from
lib.api.API
import
BaseAPI
...
@@ -9,4 +10,4 @@ class API(BaseAPI):
...
@@ -9,4 +10,4 @@ class API(BaseAPI):
methods
=
(
'default'
)
methods
=
(
'default'
)
def
default
(
self
):
def
default
(
self
):
return
self
.
GET
(
parameters
=
self
.
request
.
GET
.
dict
(
))
return
json
.
dumps
(
self
.
GET
(
parameters
=
self
.
request
.
GET
.
dict
()
))
JoinTheCityREST/lib/api/zdarzeniaDrogowe.py
View file @
0e50a5a6
import
json
from
app.API.serializers
import
APISerializer
from
app.API.serializers
import
APISerializer
from
lib.api.API
import
BaseAPI
from
lib.api.API
import
BaseAPI
...
@@ -9,4 +10,4 @@ class API(BaseAPI):
...
@@ -9,4 +10,4 @@ class API(BaseAPI):
methods
=
(
'default'
)
methods
=
(
'default'
)
def
default
(
self
):
def
default
(
self
):
return
self
.
GET
(
parameters
=
self
.
request
.
GET
.
dict
(
))
return
json
.
dumps
(
self
.
GET
(
parameters
=
self
.
request
.
GET
.
dict
()
))
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