[ckan-changes] commit/ckan: 2 new changesets

Bitbucket commits-noreply at bitbucket.org
Tue Jun 21 10:09:23 UTC 2011


2 new changesets in ckan:

http://bitbucket.org/okfn/ckan/changeset/1646c690d0da/
changeset:   1646c690d0da
user:        dread
date:        2011-06-20 12:51:43
summary:     [model][xs]: Simplify import of datetime, since modules which import ckan.model also get this import, and may not want datetime.datetime imported as datetime.
affected #:  4 files (20 bytes)

--- a/ckan/model/authorization_group.py	Mon Jun 20 00:23:54 2011 +0100
+++ b/ckan/model/authorization_group.py	Mon Jun 20 11:51:43 2011 +0100
@@ -1,4 +1,4 @@
-from datetime import datetime
+import datetime
 
 from meta import *
 from core import DomainObject
@@ -8,7 +8,7 @@
 authorization_group_table = Table('authorization_group', metadata,
     Column('id', UnicodeText, primary_key=True, default=make_uuid),
     Column('name', UnicodeText),
-    Column('created', DateTime, default=datetime.now),
+    Column('created', DateTime, default=datetime.datetime.now),
     )
 
 authorization_group_user_table = Table('authorization_group_user', metadata,


--- a/ckan/model/group.py	Mon Jun 20 00:23:54 2011 +0100
+++ b/ckan/model/group.py	Mon Jun 20 11:51:43 2011 +0100
@@ -1,4 +1,4 @@
-from datetime import datetime
+import datetime
 
 from meta import *
 from core import *
@@ -26,7 +26,7 @@
     Column('name', UnicodeText, nullable=False, unique=True),
     Column('title', UnicodeText),
     Column('description', UnicodeText),
-    Column('created', DateTime, default=datetime.now),
+    Column('created', DateTime, default=datetime.datetime.now),
     )
 
 vdm.sqlalchemy.make_table_stateful(group_table)


--- a/ckan/model/rating.py	Mon Jun 20 00:23:54 2011 +0100
+++ b/ckan/model/rating.py	Mon Jun 20 11:51:43 2011 +0100
@@ -1,4 +1,4 @@
-from datetime import datetime
+import datetime
 
 from meta import *
 from core import *
@@ -14,7 +14,7 @@
                      Column('user_ip_address', UnicodeText), # alternative to user_id if not logged in
                      Column('package_id', UnicodeText, ForeignKey('package.id')),
                      Column('rating', Float),
-                     Column('created', DateTime, default=datetime.now),
+                     Column('created', DateTime, default=datetime.datetime.now),
                      )
 
 class Rating(DomainObject):


--- a/ckan/model/user.py	Mon Jun 20 00:23:54 2011 +0100
+++ b/ckan/model/user.py	Mon Jun 20 11:51:43 2011 +0100
@@ -1,4 +1,4 @@
-from datetime import datetime
+import datetime
 import re
 import os
 from hashlib import sha1
@@ -17,7 +17,7 @@
         Column('fullname', UnicodeText),
         Column('email', UnicodeText),
         Column('apikey', UnicodeText, default=make_uuid),
-        Column('created', DateTime, default=datetime.now),
+        Column('created', DateTime, default=datetime.datetime.now),
         Column('about', UnicodeText),
         )
 


http://bitbucket.org/okfn/ckan/changeset/165f8137168e/
changeset:   165f8137168e
user:        dread
date:        2011-06-21 12:09:03
summary:     [forms][xs]: Change spurious prints to log statements.
affected #:  1 file (16 bytes)

--- a/ckan/forms/common.py	Mon Jun 20 11:51:43 2011 +0100
+++ b/ckan/forms/common.py	Tue Jun 21 11:09:03 2011 +0100
@@ -1,4 +1,5 @@
 import re
+import logging
 
 from formalchemy import helpers as fa_h
 import formalchemy
@@ -14,6 +15,8 @@
 import ckan.lib.field_types as field_types
 import ckan.misc
 
+log = logging.getLogger(__name__)
+
 name_match = re.compile('[a-z0-9_\-]*$')
 def name_validator(val, field=None):
     # check basic textual rules
@@ -337,7 +340,6 @@
 
     def resource_validator(self, val, field=None):
         resources_data = val
-        print resources_data
         assert isinstance(resources_data, list)
         not_nothing_regex = re.compile('\S')
         errormsg = _('Package resource(s) incomplete.')
@@ -624,7 +626,7 @@
                 elif key_parts[2].startswith('newfield'):
                     newfield_match = self.newfield_re.match(key_parts[2])
                     if not newfield_match:
-                        print 'Warning: did not parse newfield correctly: ', key_parts
+                        log.warn('Did not parse newfield correctly: %r', key_parts)
                         continue
                     new_field_index, key_or_value = newfield_match.groups()
                     if key_or_value == 'key':
@@ -640,7 +642,7 @@
                         if not self.params.has_key(key_key):
                             extra_fields.append(('', value))
                     else:
-                        print 'Warning: expected key or value for newfield: ', key
+                        log.warn('Expected key or value for newfield: %r' % key)
                 elif key_parts[2].endswith('-checkbox'):
                     continue
                 else:

Repository URL: https://bitbucket.org/okfn/ckan/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list