mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Import Skill information from the API, also provide new Auth API to access this information
This commit is contained in:
@@ -14,7 +14,7 @@ from django.shortcuts import get_object_or_404
|
||||
from api.models import AuthAPIKey, AuthAPILog
|
||||
from eve_proxy.models import CachedDocument
|
||||
from eve_proxy.exceptions import *
|
||||
from eve_api.models import EVEAccount
|
||||
from eve_api.models import EVEAccount, EVEPlayerCharacter
|
||||
from sso.models import ServiceAccount, Service
|
||||
from hr.models import Blacklist
|
||||
|
||||
@@ -212,3 +212,21 @@ class BlacklistHandler(BaseHandler):
|
||||
obj = []
|
||||
|
||||
return obj
|
||||
|
||||
|
||||
class CharacterHandler(BaseHandler):
|
||||
allowed_methods = ('GET')
|
||||
exclude = ('_state',)
|
||||
|
||||
def read(self, request):
|
||||
s = []
|
||||
|
||||
if request.GET.get('id', None):
|
||||
s = get_object_or_404(EVEPlayerCharacter, pk=id)
|
||||
elif request.GET.get('corpid', None):
|
||||
s = EVEPlayerCharacter.objects.filter(corporation__id=request.GET['corpid'])
|
||||
elif request.GET.get('allianceid', None):
|
||||
s = EVEPlayerCharacter.objects.filter(corporation__alliance__id=request.GET['allianceid'])
|
||||
|
||||
return {'characters': s}
|
||||
|
||||
|
||||
@@ -15,12 +15,14 @@ eveapi_resource = Resource(handler=EveAPIHandler, **apikeyauth)
|
||||
eveapiproxy_resource = Resource(handler=EveAPIProxyHandler, **apikeyauth)
|
||||
optimer_resource = Resource(handler=OpTimerHandler, **apikeyauth)
|
||||
blacklist_resource = Resource(handler=BlacklistHandler, **apikeyauth)
|
||||
characters_resource = Resource(handler=CharacterHandler, **apikeyauth)
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^user/$', user_resource),
|
||||
url(r'^login/$', login_resource),
|
||||
url(r'^eveapi/$', eveapi_resource),
|
||||
url(r'^eveapi/', eveapiproxy_resource, name='api-eveapiproxy'),
|
||||
url(r'^character/$', characters_resource),
|
||||
url(r'^optimer/$', optimer_resource),
|
||||
url(r'^blacklist/$', blacklist_resource),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user