Commit 73af1f0a authored by Rafal's avatar Rafal

add description, icon_www

parent 4c7196ee
......@@ -10,20 +10,20 @@ class Command(BaseCommand):
def handle(self, *args, **options):
apis = [
['Apteki w Krakowie', 'Krakow', 'map', 'apteki'],
['Baseny w Krakowie', 'Krakow', 'map', 'baseny'],
['Hotele w Krakowie', 'Krakow', 'map',' hotele'],
['HotSpoty w Krakowie', 'Krakow', 'map',' mapaHotSpotow'],
['Utrudnienia w Krakowie', 'Krakow', 'map',' mapaUtrudnien'],
['Restauracje w Krakowie', 'Krakow', 'map',' restauracje'],
['Szpitale w Krakowie', 'Krakow', 'map',' szpitale'],
['Zdarzenia drogowe w Krakowie', 'Krakow', 'map',' zdarzeniaDrogowe'],
['Apteki w Krakowie', 'Krakow', 'map', 'apteki', '', 'Opis API o aptekach w Krakowie'],
['Baseny w Krakowie', 'Krakow', 'map', 'baseny', '', 'Opis API o aptekach w Krakowie'],
['Hotele w Krakowie', 'Krakow', 'map',' hotele', '', 'Opis API o aptekach w Krakowie'],
['HotSpoty w Krakowie', 'Krakow', 'map',' mapaHotSpotow', '', 'Opis API o aptekach w Krakowie'],
['Utrudnienia w Krakowie', 'Krakow', 'map',' mapaUtrudnien', '', 'Opis API o aptekach w Krakowie'],
['Restauracje w Krakowie', 'Krakow', 'map',' restauracje', '', 'Opis API o aptekach w Krakowie'],
['Szpitale w Krakowie', 'Krakow', 'map',' szpitale', '', 'Opis API o aptekach w Krakowie'],
['Zdarzenia drogowe w Krakowie', 'Krakow', 'map',' zdarzeniaDrogowe', '', 'Opis API o aptekach w Krakowie'],
]
print "Creating APIs"
for api in apis:
print "Create {0}".format(api[0])
tag = Tag.objects.filter(name=api[1])[0]
api_type = APIType.objects.filter(name=api[2])[0]
new_api = API.objects.create(name=api[0], type=api_type, source=api[3])
new_api = API.objects.create(name=api[0], type=api_type, source=api[3], icon_www=api[4], description = api[5])
new_api.tag = [tag, ]
new_api.save()
\ No newline at end of file
......@@ -18,6 +18,8 @@ class API(models.Model):
type = models.ForeignKey(APIType, related_name='API_type',
blank=False, null=False, default=None)
source = models.CharField(max_length=100)
icon_www = models.CharField(max_length=100, default=None, null=True, blank=True)
description = models.CharField(max_length=300, default=None, null=True, blank=True)
def __str__(self):
......
......@@ -6,7 +6,7 @@ class APISerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = API
fields = ('url', 'name', 'tag' ,'type', 'source')
fields = ('url', 'name', 'tag' ,'type', 'source', 'icon_www', 'description')
class APITypeSerializer(serializers.HyperlinkedModelSerializer):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment