Author: brosner
Date: Tue Dec 30 13:43:36 2008
New Revision: 125

Modified:
    trunk/notification/models.py

Log:
Honor the default syncdb verbosity when creating notice types.

To honor all verbosity levels *all* callers of create_notice_types needs to
pass in the verbosity keyword argument from inside create_notice_types.

Modified: trunk/notification/models.py
==============================================================================
--- trunk/notification/models.py        (original)
+++ trunk/notification/models.py        Tue Dec 30 13:43:36 2008
@@ -169,7 +169,7 @@
      """
      pickled_data = models.TextField()

-def create_notice_type(label, display, description, default=2):
+def create_notice_type(label, display, description, default=2,  
verbosity=1):
      """
      Creates a new NoticeType.

@@ -189,10 +189,12 @@
              updated = True
          if updated:
              notice_type.save()
-            print "Updated %s NoticeType" % label
+            if verbosity > 1:
+                print "Updated %s NoticeType" % label
      except NoticeType.DoesNotExist:
          NoticeType(label=label, display=display, description=description,  
default=default).save()
-        print "Created %s NoticeType" % label
+        if verbosity > 1:
+            print "Created %s NoticeType" % label

  def get_notification_language(user):
      """

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to