# 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)
for item in data:
profile = cls(**item)
profile.save()
def __unicode__(self):
return self.title
IyBlbmNvZGluZz11dGYtOApjbGFzcyBPZGVza1Byb2ZpbGUobW9kZWxzLk1vZGVsKToKICAgIHRpdGxlID0gbW9kZWxzLkNoYXJGaWVsZChtYXhfbGVuZ3RoPTI1NSkKICAgIHNraWxscyA9IG1vZGVscy5DaGFyRmllbGQobWF4X2xlbmd0aD0yNTUpCiAgICBjb3VudHJ5ID0gbW9kZWxzLkNoYXJGaWVsZChtYXhfbGVuZ3RoPTI1NSkKICAgIHByb2ZpbGVfaWQgPSBtb2RlbHMuQ2hhckZpZWxkKG1heF9sZW5ndGg9MjU1KQogCiAgICBAY2xhc3NtZXRob2QKICAgIGRlZiBmaWxsKGNscyk6CiAgICAgICAgIyDQntGH0LXQstC40LTQvdC+INGH0YLQviDRgdGH0LjRgtGL0LLQsNC90LjQtSDRhNCw0LnQu9CwINC80L7QttC90L4g0LfQsNC80LXQvdC40YLRjCDQvdCwINC30LDQv9GA0L7RgSDQsiBSRVNUIEFQSS4KICAgICAgICAjINC4INC/0L7RgtC+0Lwg0LjRgtC10YDQuNGA0L7QstCw0YLRjCDQv9C+IGpzb24t0LzQsNGB0YHQuNCy0YMuCiAgICAgICAgd2l0aCBvcGVuKCd0ZXN0Lmpzb24nKSBhcyBkYXRhX2ZpbGU6CiAgICAgICAgICAgIGRhdGEgPSBqc29uLmxvYWQoZGF0YV9maWxlKQogCiAJCWZvciBpdGVtIGluIGRhdGE6CiAgICAgICAgCXByb2ZpbGUgPSBjbHMoKippdGVtKQogICAgICAgIAlwcm9maWxlLnNhdmUoKQogCiAgICBkZWYgX191bmljb2RlX18oc2VsZik6CiAgICAgICAgcmV0dXJuIHNlbGYudGl0bGU=
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/py_compile.py", line 117, in compile
raise py_exc
py_compile.PyCompileError: Sorry: IndentationError: unexpected indent (prog.py, line 15)