community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r1693009 - in /comdev/tools: events_list/models.py events_list/views.py readme.md
Date Tue, 28 Jul 2015 07:40:11 GMT
Author: rgardler
Date: Tue Jul 28 07:40:11 2015
New Revision: 1693009

URL: http://svn.apache.org/r1693009
Log:
grab some useful information about group members

Modified:
    comdev/tools/events_list/models.py
    comdev/tools/events_list/views.py
    comdev/tools/readme.md

Modified: comdev/tools/events_list/models.py
URL: http://svn.apache.org/viewvc/comdev/tools/events_list/models.py?rev=1693009&r1=1693008&r2=1693009&view=diff
==============================================================================
--- comdev/tools/events_list/models.py (original)
+++ comdev/tools/events_list/models.py Tue Jul 28 07:40:11 2015
@@ -24,9 +24,20 @@ class Hashtag(models.Model):
         return unicode(self.name)
 
 class Person(models.Model):
-    bio = models.TextField(default="None provided.")
+    name = models.CharField(max_length = 50)
+    country = models.CharField(max_length = 2)
+    state = models.CharField(max_length = 2)
+    city = models.CharField(max_length = 30)
+    url = models.URLField(default="")
+    lastVisit = models.DateTimeField()
     meetupID =  models.BigIntegerField(verbose_name = "Meetups.com ID", unique=True)
 
+    def __str__(self):
+        return self.name
+
+    def __unicode__(self):
+        return unicode(self.name)
+
 class Event(models.Model):
     name = models.CharField(max_length=200)
     event_url = models.URLField()

Modified: comdev/tools/events_list/views.py
URL: http://svn.apache.org/viewvc/comdev/tools/events_list/views.py?rev=1693009&r1=1693008&r2=1693009&view=diff
==============================================================================
--- comdev/tools/events_list/views.py (original)
+++ comdev/tools/events_list/views.py Tue Jul 28 07:40:11 2015
@@ -91,7 +91,7 @@ def importMembers(request, group_id):
     log.action_type = Log.EVENT_IMPORT
     log.save()
 
-    url = "https://api.meetup.com/2/members?offset=0&format=json&group_id=18712511&photo-host=public&page=20&order=name&sig_id=148657742&key="
+ MEETUP_API_KEY
+    url = "https://api.meetup.com/2/members?offset=0&format=json&group_id=18712511&photo-host=public&page=100&order=name&sig_id=148657742&key="
+ MEETUP_API_KEY
     response = urllib2.urlopen(url)
     result = response.read()
 
@@ -106,6 +106,13 @@ def importMembers(request, group_id):
 
         try:
             person.meetupID = member['id']
+            person.name = member['name']
+            person.country = member['country']
+            person.state = member['state']
+            person.city = member['city']
+            person.url = member['link']
+            visited = float(str(member['visited'])[0:-3])
+            person.lastVisit = datetime.utcfromtimestamp(visited)
             person.save()
         except:
             print('Unable to save Person object: '), sys.exc_info()[0], sys.exc_info()[1]

Modified: comdev/tools/readme.md
URL: http://svn.apache.org/viewvc/comdev/tools/readme.md?rev=1693009&r1=1693008&r2=1693009&view=diff
==============================================================================
--- comdev/tools/readme.md (original)
+++ comdev/tools/readme.md Tue Jul 28 07:40:11 2015
@@ -142,7 +142,10 @@ migrations and execute them):
         $ script/migrateDev.sh
 
 NOTE: This will only work if each new field has defaults provided. The
-system will report errors if no defaults are defined.
+system will report errors if no defaults are defined. If you do not
+want to have a default in the final version of the database simply add
+a default, run the migration, then remove the default and run the
+migration again.
 
 ### Running Django Commands ###
 



Mime
View raw message