File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 55class ContextView (object ):
66 """Contextual view class."""
77
8- __model__ = None
8+ __model_cls__ = None
99
1010 def __init__ (self , model ):
1111 """Model validation.
1212
1313 :param model: DomainModel
1414 """
15- if not issubclass (self .__model__ , models .DomainModel ):
15+ if not issubclass (self .__model_cls__ , models .DomainModel ):
1616 raise TypeError ("Attribute __model__ must be subclass of "
1717 "DomainModel" )
1818
19- if not isinstance (model , self .__model__ ):
19+ if not isinstance (model , self .__model_cls__ ):
2020 raise TypeError ("\" {0}\" is not an instance of {1}" .format (
21- model , self .__model__ ))
21+ model , self .__model_cls__ ))
2222
2323 self .__model__ = model
2424
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ class Profile(models.DomainModel):
3030
3131class PublicProfile (views .ContextView ):
3232 """Profile data in public context."""
33- __model__ = Profile
33+ __model_cls__ = Profile
3434
3535 def _get_oid (self ):
3636 """Calculate open id.
@@ -60,7 +60,7 @@ def get_data(self):
6060
6161class PrivateProfile (views .ContextView ):
6262 """Profile data in private context."""
63- __model__ = Profile
63+ __model_cls__ = Profile
6464
6565 def _get_photos (self ):
6666 photos = []
@@ -85,7 +85,7 @@ def get_data(self):
8585
8686class PublicPhoto (views .ContextView ):
8787 """Photo data in public context."""
88- __model__ = Photo
88+ __model_cls__ = Photo
8989
9090 def _get_oid (self ):
9191 return self .__model__ .id << 8
@@ -101,7 +101,7 @@ def get_data(self):
101101
102102
103103class PrivatePhoto (views .ContextView ):
104- __model__ = Photo
104+ __model_cls__ = Photo
105105
106106 def get_data (self ):
107107 return {
@@ -120,15 +120,15 @@ def get_data(self):
120120
121121class WrongModelContext (views .ContextView ):
122122 """Wrong model defined."""
123- __model__ = type
123+ __model_cls__ = type
124124
125125 def get_data (self ):
126126 pass
127127
128128
129129class GetterUndefinedContext (views .ContextView ):
130130 """Getter undefined."""
131- __model__ = Profile
131+ __model_cls__ = Profile
132132
133133
134134class TestContextView (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments