# encoding=utf-8
class OdeskProfile(models.Model):
title = models.CharField(max_length=255)
skills = models.CharField(max_length=255)
country = models.CharField(max_length=255)
profile_id = models.CharField(max_length=255)
@classmethod
def fill(cls):
# Очевидно что считывание файла можно заменить на запрос в REST API.
# и потом итерировать по json-массиву.
with open('test.json') as data_file:
data = json.load(data_file)
profile = cls(**data)
profile.save()
def __unicode__(self):
return self.title
IyBlbmNvZGluZz11dGYtOApjbGFzcyBPZGVza1Byb2ZpbGUobW9kZWxzLk1vZGVsKToKICAgIHRpdGxlID0gbW9kZWxzLkNoYXJGaWVsZChtYXhfbGVuZ3RoPTI1NSkKICAgIHNraWxscyA9IG1vZGVscy5DaGFyRmllbGQobWF4X2xlbmd0aD0yNTUpCiAgICBjb3VudHJ5ID0gbW9kZWxzLkNoYXJGaWVsZChtYXhfbGVuZ3RoPTI1NSkKICAgIHByb2ZpbGVfaWQgPSBtb2RlbHMuQ2hhckZpZWxkKG1heF9sZW5ndGg9MjU1KQoKICAgIEBjbGFzc21ldGhvZAogICAgZGVmIGZpbGwoY2xzKToKICAgICAgICAjINCe0YfQtdCy0LjQtNC90L4g0YfRgtC+INGB0YfQuNGC0YvQstCw0L3QuNC1INGE0LDQudC70LAg0LzQvtC20L3QviDQt9Cw0LzQtdC90LjRgtGMINC90LAg0LfQsNC/0YDQvtGBINCyIFJFU1QgQVBJLgogICAgICAgICMg0Lgg0L/QvtGC0L7QvCDQuNGC0LXRgNC40YDQvtCy0LDRgtGMINC/0L4ganNvbi3QvNCw0YHRgdC40LLRgy4KICAgICAgICB3aXRoIG9wZW4oJ3Rlc3QuanNvbicpIGFzIGRhdGFfZmlsZToKICAgICAgICAgICAgZGF0YSA9IGpzb24ubG9hZChkYXRhX2ZpbGUpCgogICAgICAgIHByb2ZpbGUgPSBjbHMoKipkYXRhKQogICAgICAgIHByb2ZpbGUuc2F2ZSgpCgogICAgZGVmIF9fdW5pY29kZV9fKHNlbGYpOgogICAgICAgIHJldHVybiBzZWxmLnRpdGxlCg==