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)
def fill(self):
with open('test.json') as data_file:
data = json.load(data_file)
for items in data:
test = OdeskProfile.objects.all()
test.title = data[items]['title']
test.skills = data[items]['skills']
test.country = data[items]['country']
test.profile_id = data[items]['id']
test.save()
def __unicode__(self):
return self.title
Y2xhc3MgT2Rlc2tQcm9maWxlKG1vZGVscy5Nb2RlbCk6CiAgICB0aXRsZSA9IG1vZGVscy5DaGFyRmllbGQobWF4X2xlbmd0aD0yNTUpCiAgICBza2lsbHMgPSBtb2RlbHMuQ2hhckZpZWxkKG1heF9sZW5ndGg9MjU1KQogICAgY291bnRyeSA9IG1vZGVscy5DaGFyRmllbGQobWF4X2xlbmd0aD0yNTUpCiAgICBwcm9maWxlX2lkID0gbW9kZWxzLkNoYXJGaWVsZChtYXhfbGVuZ3RoPTI1NSkKICAgIAogICAgZGVmIGZpbGwoc2VsZik6CiAgICAgICAgd2l0aCBvcGVuKCd0ZXN0Lmpzb24nKSBhcyBkYXRhX2ZpbGU6ICAgIAogICAgICAgICAgICBkYXRhID0ganNvbi5sb2FkKGRhdGFfZmlsZSkKICAgICAgICBmb3IgaXRlbXMgaW4gZGF0YToKICAgICAgICAgICAgdGVzdCA9IE9kZXNrUHJvZmlsZS5vYmplY3RzLmFsbCgpCiAgICAgICAgICAgIHRlc3QudGl0bGUgPSBkYXRhW2l0ZW1zXVsndGl0bGUnXQogICAgICAgICAgICB0ZXN0LnNraWxscyA9IGRhdGFbaXRlbXNdWydza2lsbHMnXQogICAgICAgICAgICB0ZXN0LmNvdW50cnkgPSBkYXRhW2l0ZW1zXVsnY291bnRyeSddCiAgICAgICAgICAgIHRlc3QucHJvZmlsZV9pZCA9IGRhdGFbaXRlbXNdWydpZCddCiAgICAgICAgdGVzdC5zYXZlKCkKICAgICAgICAgICAgCiAgICBkZWYgX191bmljb2RlX18oc2VsZik6CiAgICAgICAgcmV0dXJuIHNlbGYudGl0bGU=