Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import getorg data #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Import getorg data #81

wants to merge 1 commit into from

Conversation

sks444
Copy link
Member

@sks444 sks444 commented Feb 19, 2018

Closes #18


gh_key = 'Your_github_token'

#https://developers.google.com/maps/documentation/javascript/get-api-key
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code does not comply to PEP8.

Origin: PEP8Bear, Section: all.autopep8.

The issue can be fixed by applying the following patch:

--- a/tmp/tmp_u3roec1/community/settings.py
+++ b/tmp/tmp_u3roec1/community/settings.py
@@ -126,5 +126,5 @@
 
 gh_key = 'Your_github_token'
 
-#https://developers.google.com/maps/documentation/javascript/get-api-key
+# https://developers.google.com/maps/documentation/javascript/get-api-key
 GEOPOSITION_GOOGLE_MAPS_API_KEY = 'YOUR_API_KEY'


gh_key = 'Your_github_token'

#https://developers.google.com/maps/documentation/javascript/get-api-key
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E265 block comment should start with '# '

Origin: PycodestyleBear (E265), Section: all.autopep8.


gh_key = 'Your_github_token'

#https://developers.google.com/maps/documentation/javascript/get-api-key
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code does not comply to PEP8.

Origin: PEP8Bear, Section: all.autopep8.

The issue can be fixed by applying the following patch:

--- a/tmp/tmpxjkkgmwn/community/settings.py
+++ b/tmp/tmpxjkkgmwn/community/settings.py
@@ -126,5 +126,5 @@
 
 gh_key = 'Your_github_token'
 
-#https://developers.google.com/maps/documentation/javascript/get-api-key
+# https://developers.google.com/maps/documentation/javascript/get-api-key
 GEOPOSITION_GOOGLE_MAPS_API_KEY = 'YOUR_API_KEY'


gh_key = 'Your_github_token'

#https://developers.google.com/maps/documentation/javascript/get-api-key
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E265 block comment should start with '# '

Origin: PycodestyleBear (E265), Section: all.autopep8.

@sks444
Copy link
Member Author

sks444 commented Feb 19, 2018

@jayvdb , A PR for storing participant geolocation to data model. :)
And I am sorry, I have done some terrible mistakes. That's why I will be having two closed PR in closed PR section. I tried to correct the mistakes but it got more worse, I am sorry for that, It will not happen again.

@sks444
Copy link
Member Author

sks444 commented Feb 19, 2018

This PR uses django-geoposition for storing geolocations and getorg for fetching geolocation of participants for a organisation.

@jayvdb
Copy link
Member

jayvdb commented Mar 10, 2018

nice strategy. IMO we need a getorg data model, as it has lots of lovely data.

And then we need the geolocation data model to link to the data in the getorg data model.

Worth considering, ... the OpenHub data model will also give us similar user information, so that will also need to be integrated, and we now have the 'coala.io API' user data.

Eventually ... we need a single 'person' , with links to various datasets that we import about that person.

@sks444
Copy link
Member Author

sks444 commented Mar 10, 2018

IMO we need a getorg data model, as it has lots of lovely data.

Alright, I will try get some more data from their 👍

@gitmate-bot
Copy link
Collaborator

Sorry @sks444, you do not have the necessary permission levels to perform the action.

@sks444
Copy link
Member Author

sks444 commented Mar 10, 2018

Eventually ... we need a single 'person' , with links to various datasets that we import about that person.

Yeah, I was thinking of it too, we will work on that 👍

@gitmate-bot
Copy link
Collaborator

Sorry @sks444, you do not have the necessary permission levels to perform the action.

Makes a GET request to the API.
"""
for key, value in org_location_dict.items():
self.import_data(key, value)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line contains following spacing inconsistencies:

  • Tabs used instead of spaces.

Origin: SpaceConsistencyBear, Section: all.whitespace.

The issue can be fixed by applying the following patch:

--- a/tmp/tmpcu_8idl1/geolocation/management/commands/import_geolocation.py
+++ b/tmp/tmpcu_8idl1/geolocation/management/commands/import_geolocation.py
@@ -37,4 +37,4 @@
         Makes a GET request to the  API.
         """
         for key, value in org_location_dict.items():
-        	self.import_data(key, value)
+            self.import_data(key, value)

position = GeopositionField()

def __str__(self):
return self.name
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line contains following spacing inconsistencies:

  • Tabs used instead of spaces.

Origin: SpaceConsistencyBear, Section: all.whitespace.

The issue can be fixed by applying the following patch:

--- a/tmp/tmpcu_8idl1/geolocation/models.py
+++ b/tmp/tmpcu_8idl1/geolocation/models.py
@@ -6,4 +6,4 @@
     position = GeopositionField()
 
     def __str__(self):
-    	return self.name
+        return self.name

@sks444 sks444 changed the title Add participants geolocation to data model Import getorg data Apr 3, 2018
from github import Github
import getorg

# Get an API key (for just querying, give it no write permissions) at https://github.com/settings/tokens
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is longer than allowed. (104 > 80)

Origin: LineLengthBear, Section: all.linelength.

c.save()
print ("\nContributor, {}, has been saved.".format(c))
except Exception as ex:
print ("\n\nSomething went wrong saving this contributor: {}\n{}".format(name, str(ex)))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is longer than allowed. (100 > 80)

Origin: LineLengthBear, Section: all.linelength.

from django.db import models
from geoposition.fields import GeopositionField

class Participant(models.Model):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E302 expected 2 blank lines, found 1

Origin: PycodestyleBear (E302), Section: all.python.models.

position = GeopositionField()

def __str__(self):
return self.name
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E101 indentation contains mixed spaces and tabs

Origin: PycodestyleBear (E101), Section: all.python.models.

position = GeopositionField()

def __str__(self):
return self.name
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W191 indentation contains tabs

Origin: PycodestyleBear (W191), Section: all.python.models.

@gitmate-bot gitmate-bot added size/M and removed size/S labels Apr 12, 2018
Copy link
Member

@jayvdb jayvdb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done in webservices, where it can be more appropriately cached, and then data imported here.

@jayvdb
Copy link
Member

jayvdb commented Aug 11, 2018

Maybe this should be new repo , django-getorg ?

If you can create it, I can talk to the getorg ppls and ask them to transfer it to their org.
I am sure they will be happy with that. I know the main guy from @wikimedia .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants