remove xml for now

This commit is contained in:
phalt 2014-12-15 10:13:52 +00:00
parent 3b38fe9aeb
commit dbc7895934
9 changed files with 23 additions and 25 deletions

View file

@ -12,8 +12,7 @@ serve:
python manage.py runserver --settings=config.local python manage.py runserver --settings=config.local
test: test:
python manage.py test pokemon_v1 --settings=config.local python manage.py test --settings=config.local
python manage.py test pokemon_v2 --settings=config.local
clean: clean:
rm -rf *.pyc rm -rf *.pyc

View file

@ -125,7 +125,7 @@ INSTALLED_APPS = (
API_LIMIT_PER_PAGE = 1 API_LIMIT_PER_PAGE = 1
TASTYPIE_DEFAULT_FORMATS = ['json', 'xml'] TASTYPIE_DEFAULT_FORMATS = ['json']
CORS_ORIGIN_ALLOW_ALL = True CORS_ORIGIN_ALLOW_ALL = True
CORS_ALLOW_METHODS = ( CORS_ALLOW_METHODS = (

View file

@ -12,7 +12,7 @@ admin.autodiscover()
# API v1 # API v1
from pokemon_v1.api import ( from pokemon.api import (
PokemonResource, TypeResource, AbilityResource, GameResource, PokemonResource, TypeResource, AbilityResource, GameResource,
SpriteResource, DescriptionResource, EggResource, MoveResource, SpriteResource, DescriptionResource, EggResource, MoveResource,
PokedexResource PokedexResource

View file

@ -5,7 +5,7 @@ from django.shortcuts import render_to_response
from django.template import RequestContext from django.template import RequestContext
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from pokemon_v1.models import ( from pokemon.models import (
Pokemon, Sprite, Move, Description, Game, Pokemon, Sprite, Move, Description, Game,
EggGroup, Type, Ability, MovePokemon EggGroup, Type, Ability, MovePokemon
) )

View file

@ -1,5 +1,5 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from pokemon_v1.models import ( from .models import (
Pokemon, Sprite, Move, Description, Game, Pokemon, Sprite, Move, Description, Game,
EggGroup, Type, Ability, Evolution, MovePokemon, EggGroup, Type, Ability, Evolution, MovePokemon,
TypeChart, Pokedex TypeChart, Pokedex

View file

@ -1 +1 @@
[{"pk": 1, "model": "pokemon_v1.ability", "fields": {"description": "You do not want to know", "modified": "2014-07-28T21:25:21.039Z", "name": "Harden", "created": "2014-07-28T21:25:21.039Z"}}, {"pk": 1, "model": "pokemon_v1.type", "fields": {"modified": "2014-07-28T21:22:38.583Z", "name": "Fire", "created": "2014-07-28T21:22:38.583Z"}}, {"pk": 2, "model": "pokemon_v1.type", "fields": {"modified": "2014-07-28T21:22:41.821Z", "name": "Water", "created": "2014-07-28T21:22:41.821Z"}}, {"pk": 1, "model": "pokemon_v1.typechart", "fields": {"to": 2, "ttype": "weak", "modified": "2014-07-28T21:22:57.494Z", "frm": 1, "created": "2014-07-28T21:22:57.494Z"}}, {"pk": 2, "model": "pokemon_v1.typechart", "fields": {"to": 1, "ttype": "super effective", "modified": "2014-07-28T21:23:04.357Z", "frm": 2, "created": "2014-07-28T21:23:04.357Z"}}, {"pk": 1, "model": "pokemon_v1.egggroup", "fields": {"modified": "2014-07-28T21:24:49.363Z", "name": "Fairy", "created": "2014-07-28T21:24:49.363Z"}}, {"pk": 1, "model": "pokemon_v1.game", "fields": {"generation": 1, "release_year": 1995, "modified": "2014-07-28T21:24:35.166Z", "name": "Red", "created": "2014-07-28T21:24:35.166Z"}}, {"pk": 1, "model": "pokemon_v1.description", "fields": {"description": "This Pokemon is basically a weird plant thing", "game": [1], "modified": "2014-07-28T21:25:08.358Z", "name": "bulbasaur_red", "created": "2014-07-28T21:25:08.358Z"}}, {"pk": 2, "model": "pokemon_v1.description", "fields": {"description": "This pokemon looks even stranger", "game": [1], "modified": "2014-07-28T21:26:52.222Z", "name": "ivysaur_red", "created": "2014-07-28T21:26:52.222Z"}}, {"pk": 1, "model": "pokemon_v1.move", "fields": {"category": "physical", "pp": 5, "description": "A basic tackle attack", "power": 10, "created": "2014-07-28T21:24:05.045Z", "modified": "2014-07-28T21:24:05.045Z", "etype": [1], "accuracy": 100, "name": "Tackle"}}, {"pk": 2, "model": "pokemon_v1.move", "fields": {"category": "special", "pp": 10, "description": "The pokemon blows bubbles", "power": 40, "created": "2014-07-28T21:24:25.895Z", "modified": "2014-07-28T21:24:25.895Z", "etype": [2], "accuracy": 90, "name": "Bubble"}}, {"pk": 1, "model": "pokemon_v1.pokemon", "fields": {"egg_cycles": 20, "abilities": [1], "weight": "20", "height": "7", "defense": 20, "sp_atk": 20, "descriptions": [1], "ev_yield": "1", "total": 20, "speed": 20, "species": "plant Pokemon", "happiness": 1, "attack": 20, "egg_group": [1], "growth_rate": "slow", "pkdx_id": 1, "hp": 45, "catch_rate": 1, "sp_def": 20, "types": [1], "name": "Bulbasaur", "created": "2014-07-28T21:26:02.384Z", "modified": "2014-07-28T21:26:02.384Z", "male_female_ratio": "10/90", "exp": 1, "sprites": []}}, {"pk": 2, "model": "pokemon_v1.pokemon", "fields": {"egg_cycles": 30, "abilities": [1], "weight": "29", "height": "13", "defense": 30, "sp_atk": 30, "descriptions": [2], "ev_yield": "20", "total": 30, "speed": 30, "species": "fairy", "happiness": 20, "attack": 30, "egg_group": [1], "growth_rate": "medium slow", "pkdx_id": 2, "hp": 100, "catch_rate": 20, "sp_def": 30, "types": [2], "name": "Ivysaur", "created": "2014-07-28T21:26:55.346Z", "modified": "2014-07-28T21:26:55.346Z", "male_female_ratio": "50/50", "exp": 20, "sprites": []}}, {"pk": 1, "model": "pokemon_v1.pokedex", "fields": {"modified": "2014-07-28T21:23:36.753Z", "name": "National", "created": "2014-07-28T21:23:36.754Z"}}] [{"pk": 1, "model": "pokemon.ability", "fields": {"description": "You do not want to know", "modified": "2014-07-28T21:25:21.039Z", "name": "Harden", "created": "2014-07-28T21:25:21.039Z"}}, {"pk": 1, "model": "pokemon.type", "fields": {"modified": "2014-07-28T21:22:38.583Z", "name": "Fire", "created": "2014-07-28T21:22:38.583Z"}}, {"pk": 2, "model": "pokemon.type", "fields": {"modified": "2014-07-28T21:22:41.821Z", "name": "Water", "created": "2014-07-28T21:22:41.821Z"}}, {"pk": 1, "model": "pokemon.typechart", "fields": {"to": 2, "ttype": "weak", "modified": "2014-07-28T21:22:57.494Z", "frm": 1, "created": "2014-07-28T21:22:57.494Z"}}, {"pk": 2, "model": "pokemon.typechart", "fields": {"to": 1, "ttype": "super effective", "modified": "2014-07-28T21:23:04.357Z", "frm": 2, "created": "2014-07-28T21:23:04.357Z"}}, {"pk": 1, "model": "pokemon.egggroup", "fields": {"modified": "2014-07-28T21:24:49.363Z", "name": "Fairy", "created": "2014-07-28T21:24:49.363Z"}}, {"pk": 1, "model": "pokemon.game", "fields": {"generation": 1, "release_year": 1995, "modified": "2014-07-28T21:24:35.166Z", "name": "Red", "created": "2014-07-28T21:24:35.166Z"}}, {"pk": 1, "model": "pokemon.description", "fields": {"description": "This Pokemon is basically a weird plant thing", "game": [1], "modified": "2014-07-28T21:25:08.358Z", "name": "bulbasaur_red", "created": "2014-07-28T21:25:08.358Z"}}, {"pk": 2, "model": "pokemon.description", "fields": {"description": "This pokemon looks even stranger", "game": [1], "modified": "2014-07-28T21:26:52.222Z", "name": "ivysaur_red", "created": "2014-07-28T21:26:52.222Z"}}, {"pk": 1, "model": "pokemon.move", "fields": {"category": "physical", "pp": 5, "description": "A basic tackle attack", "power": 10, "created": "2014-07-28T21:24:05.045Z", "modified": "2014-07-28T21:24:05.045Z", "etype": [1], "accuracy": 100, "name": "Tackle"}}, {"pk": 2, "model": "pokemon.move", "fields": {"category": "special", "pp": 10, "description": "The pokemon blows bubbles", "power": 40, "created": "2014-07-28T21:24:25.895Z", "modified": "2014-07-28T21:24:25.895Z", "etype": [2], "accuracy": 90, "name": "Bubble"}}, {"pk": 1, "model": "pokemon.pokemon", "fields": {"egg_cycles": 20, "abilities": [1], "weight": "20", "height": "7", "defense": 20, "sp_atk": 20, "descriptions": [1], "ev_yield": "1", "total": 20, "speed": 20, "species": "plant Pokemon", "happiness": 1, "attack": 20, "egg_group": [1], "growth_rate": "slow", "pkdx_id": 1, "hp": 45, "catch_rate": 1, "sp_def": 20, "types": [1], "name": "Bulbasaur", "created": "2014-07-28T21:26:02.384Z", "modified": "2014-07-28T21:26:02.384Z", "male_female_ratio": "10/90", "exp": 1, "sprites": []}}, {"pk": 2, "model": "pokemon.pokemon", "fields": {"egg_cycles": 30, "abilities": [1], "weight": "29", "height": "13", "defense": 30, "sp_atk": 30, "descriptions": [2], "ev_yield": "20", "total": 30, "speed": 30, "species": "fairy", "happiness": 20, "attack": 30, "egg_group": [1], "growth_rate": "medium slow", "pkdx_id": 2, "hp": 100, "catch_rate": 20, "sp_def": 30, "types": [2], "name": "Ivysaur", "created": "2014-07-28T21:26:55.346Z", "modified": "2014-07-28T21:26:55.346Z", "male_female_ratio": "50/50", "exp": 20, "sprites": []}}, {"pk": 1, "model": "pokemon.pokedex", "fields": {"modified": "2014-07-28T21:23:36.753Z", "name": "National", "created": "2014-07-28T21:23:36.754Z"}}]

View file

@ -3,7 +3,7 @@ from __future__ import unicode_literals
from django.db import models, migrations from django.db import models, migrations
import imagekit.models.fields import imagekit.models.fields
import pokemon_v1.utils import pokemon.utils
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -109,7 +109,7 @@ class Migration(migrations.Migration):
('created', models.DateTimeField(auto_now_add=True)), ('created', models.DateTimeField(auto_now_add=True)),
('learn_type', models.CharField(default=b'level up', max_length=15, choices=[(b'level up', b'level up'), (b'machine', b'machine'), (b'egg move', b'egg move'), (b'tutor', b'tutor'), (b'other', b'other')])), ('learn_type', models.CharField(default=b'level up', max_length=15, choices=[(b'level up', b'level up'), (b'machine', b'machine'), (b'egg move', b'egg move'), (b'tutor', b'tutor'), (b'other', b'other')])),
('level', models.IntegerField(default=0, max_length=6, null=True, blank=True)), ('level', models.IntegerField(default=0, max_length=6, null=True, blank=True)),
('move', models.ForeignKey(related_name='pokemon', blank=True, to='pokemon_v1.Move', null=True)), ('move', models.ForeignKey(related_name='pokemon', blank=True, to='pokemon.Move', null=True)),
], ],
options={ options={
'abstract': False, 'abstract': False,
@ -154,9 +154,9 @@ class Migration(migrations.Migration):
('speed', models.IntegerField(max_length=4)), ('speed', models.IntegerField(max_length=4)),
('total', models.IntegerField(max_length=6)), ('total', models.IntegerField(max_length=6)),
('egg_cycles', models.IntegerField(max_length=6)), ('egg_cycles', models.IntegerField(max_length=6)),
('abilities', models.ManyToManyField(to='pokemon_v1.Ability', null=True, blank=True)), ('abilities', models.ManyToManyField(to='pokemon.Ability', null=True, blank=True)),
('descriptions', models.ManyToManyField(to='pokemon_v1.Description', null=True, blank=True)), ('descriptions', models.ManyToManyField(to='pokemon.Description', null=True, blank=True)),
('egg_group', models.ManyToManyField(to='pokemon_v1.EggGroup', null=True, blank=True)), ('egg_group', models.ManyToManyField(to='pokemon.EggGroup', null=True, blank=True)),
], ],
options={ options={
'abstract': False, 'abstract': False,
@ -170,7 +170,7 @@ class Migration(migrations.Migration):
('modified', models.DateTimeField(auto_now=True)), ('modified', models.DateTimeField(auto_now=True)),
('created', models.DateTimeField(auto_now_add=True)), ('created', models.DateTimeField(auto_now_add=True)),
('name', models.CharField(max_length=50)), ('name', models.CharField(max_length=50)),
('image', imagekit.models.fields.ProcessedImageField(upload_to=pokemon_v1.utils.unique_filename)), ('image', imagekit.models.fields.ProcessedImageField(upload_to=pokemon.utils.unique_filename)),
], ],
options={ options={
'abstract': False, 'abstract': False,
@ -197,8 +197,8 @@ class Migration(migrations.Migration):
('modified', models.DateTimeField(auto_now=True)), ('modified', models.DateTimeField(auto_now=True)),
('created', models.DateTimeField(auto_now_add=True)), ('created', models.DateTimeField(auto_now_add=True)),
('ttype', models.CharField(blank=True, max_length=15, null=True, choices=[(b'weak', b'weak'), (b'super effective', b'super effective'), (b'resistant', b'resistant'), (b'ineffective', b'ineffective'), (b'noeffect', b'noeffect'), (b'resist', b'resist')])), ('ttype', models.CharField(blank=True, max_length=15, null=True, choices=[(b'weak', b'weak'), (b'super effective', b'super effective'), (b'resistant', b'resistant'), (b'ineffective', b'ineffective'), (b'noeffect', b'noeffect'), (b'resist', b'resist')])),
('frm', models.ForeignKey(related_name='type_frm', blank=True, to='pokemon_v1.Type', null=True)), ('frm', models.ForeignKey(related_name='type_frm', blank=True, to='pokemon.Type', null=True)),
('to', models.ForeignKey(related_name='type_to', blank=True, to='pokemon_v1.Type', null=True)), ('to', models.ForeignKey(related_name='type_to', blank=True, to='pokemon.Type', null=True)),
], ],
options={ options={
'abstract': False, 'abstract': False,
@ -208,43 +208,43 @@ class Migration(migrations.Migration):
migrations.AddField( migrations.AddField(
model_name='pokemon', model_name='pokemon',
name='sprites', name='sprites',
field=models.ManyToManyField(to='pokemon_v1.Sprite', null=True, blank=True), field=models.ManyToManyField(to='pokemon.Sprite', null=True, blank=True),
preserve_default=True, preserve_default=True,
), ),
migrations.AddField( migrations.AddField(
model_name='pokemon', model_name='pokemon',
name='types', name='types',
field=models.ManyToManyField(to='pokemon_v1.Type', null=True, blank=True), field=models.ManyToManyField(to='pokemon.Type', null=True, blank=True),
preserve_default=True, preserve_default=True,
), ),
migrations.AddField( migrations.AddField(
model_name='movepokemon', model_name='movepokemon',
name='pokemon', name='pokemon',
field=models.ForeignKey(related_name='move', blank=True, to='pokemon_v1.Pokemon', null=True), field=models.ForeignKey(related_name='move', blank=True, to='pokemon.Pokemon', null=True),
preserve_default=True, preserve_default=True,
), ),
migrations.AddField( migrations.AddField(
model_name='move', model_name='move',
name='etype', name='etype',
field=models.ManyToManyField(to='pokemon_v1.Type', null=True), field=models.ManyToManyField(to='pokemon.Type', null=True),
preserve_default=True, preserve_default=True,
), ),
migrations.AddField( migrations.AddField(
model_name='evolution', model_name='evolution',
name='frm', name='frm',
field=models.ForeignKey(related_name='frm_evol_pokemon', blank=True, to='pokemon_v1.Pokemon', null=True), field=models.ForeignKey(related_name='frm_evol_pokemon', blank=True, to='pokemon.Pokemon', null=True),
preserve_default=True, preserve_default=True,
), ),
migrations.AddField( migrations.AddField(
model_name='evolution', model_name='evolution',
name='to', name='to',
field=models.ForeignKey(related_name='to_evol_pokemon', blank=True, to='pokemon_v1.Pokemon', null=True), field=models.ForeignKey(related_name='to_evol_pokemon', blank=True, to='pokemon.Pokemon', null=True),
preserve_default=True, preserve_default=True,
), ),
migrations.AddField( migrations.AddField(
model_name='description', model_name='description',
name='game', name='game',
field=models.ManyToManyField(to='pokemon_v1.Game', null=True, blank=True), field=models.ManyToManyField(to='pokemon.Game', null=True, blank=True),
preserve_default=True, preserve_default=True,
), ),
] ]

View file

@ -1,7 +1,6 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.test import TestCase from django.test import TestCase
# Create your tests here.
class HeaderTest(TestCase): class HeaderTest(TestCase):
@ -11,6 +10,6 @@ class HeaderTest(TestCase):
'/api/v2/pokemon/1/', '/api/v2/pokemon/1/',
HTTP_ORIGIN="http://pokemon.com" HTTP_ORIGIN="http://pokemon.com"
) )
self.assertEqual(response['Access-Control-Allow-Origin'], '*') self.assertEqual(response['Access-Control-Allow-Origin'], '*')

View file

@ -4,6 +4,7 @@ South==1.0
Unipath==1.0 Unipath==1.0
coverage==3.6 coverage==3.6
django-appconf==0.6 django-appconf==0.6
django-cors-headers==1.0.0
django-discover-runner==0.4 django-discover-runner==0.4
django-imagekit==3.2.4 django-imagekit==3.2.4
django-tastypie==0.12.1 django-tastypie==0.12.1
@ -17,4 +18,3 @@ python-mimeparse==0.1.4
simplejson==3.6.5 simplejson==3.6.5
six==1.8.0 six==1.8.0
wsgiref==0.1.2 wsgiref==0.1.2
django-cors-headers=0.13