1. Peter Sanchez
  2. webutils

Commits

Peter Sanchez  committed 2d29e02

Renamed field and added super() call to IsActiveManger.

  • Participants
  • Parent commits c5785a1
  • Branches trunk

Comments (0)

Files changed (1)

File webutils/djtools/managers.py

View file
 
 class IsActiveManager(models.Manager):
     def __init__(self, field_name='is_active', 
-                 field_state=True, *args, **kwargs):
+                 field_value=True, *args, **kwargs):
         self.field_name = field_name
-        self.field_state = field_state
+        self.field_value = field_value
+        super(IsActiveManager, self).__init__(*args, **kwargs)
 
     def get_query_set(self):
         qs = super(IsActiveManager, self).get_query_set()
-        return qs.filter(**{self.field_name: self.field_state})
+        return qs.filter(**{self.field_name: self.field_value})