Skip to content

Commit

Permalink
data/: Add location to Contributors model
Browse files Browse the repository at this point in the history
  • Loading branch information
KVGarg committed Jun 9, 2019
1 parent 9a7b5f4 commit fe74f98
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions data/contrib_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ def import_data(contributor):
try:
contributor['issues_opened'] = contributor.pop('issues')
contributor['num_commits'] = contributor.pop('contributions')
contributor_location = contributor.get('location')
if contributor_location:
contributor['location'] = contributor_location
contributor.pop('teams')
c, create = Contributor.objects.get_or_create(
**contributor
Expand Down
18 changes: 18 additions & 0 deletions data/migrations/0005_contributor_location.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.1.7 on 2019-06-08 08:01

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('data', '0004_auto_20180809_2229'),
]

operations = [
migrations.AddField(
model_name='contributor',
name='location',
field=models.TextField(default=None, null=True),
),
]
1 change: 1 addition & 0 deletions data/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Contributor(models.Model):
num_commits = models.IntegerField(default=None, null=True)
reviews = models.IntegerField(default=None, null=True)
issues_opened = models.IntegerField(default=None, null=True)
location = models.TextField(default=None, null=True)
teams = models.ManyToManyField(Team)

def __str__(self):
Expand Down

0 comments on commit fe74f98

Please sign in to comment.