| 126 | | class User(models.Model): |
| | 126 | class UserClass(object): |
| | 127 | id = None |
| | 128 | username = '' |
| | 129 | is_staff = False |
| | 130 | is_active = True |
| | 131 | is_superuser = False |
| | 132 | |
| | 133 | def __init__(self): |
| | 134 | raise NotImplementedError, _(('UserClass is an abstract class. Use ' |
| | 135 | 'either User or AnonymousUser instead.')) |
| | 136 | |
| | 137 | def __unicode__(self): |
| | 138 | raise NotImplementedError |
| | 139 | |
| | 140 | def __str__(self): |
| | 141 | raise NotImplementedError |
| | 142 | |
| | 143 | def __eq__(self, other): |
| | 144 | raise NotImplementedError |
| | 145 | |
| | 146 | def __ne__(self, other): |
| | 147 | raise NotImplementedError |
| | 148 | |
| | 149 | def __hash__(self): |
| | 150 | raise NotImplementedError |
| | 151 | |
| | 152 | def save(self): |
| | 153 | raise NotImplementedError |
| | 154 | |
| | 155 | def delete(self): |
| | 156 | raise NotImplementedError |
| | 157 | |
| | 158 | def set_password(self, raw_password): |
| | 159 | raise NotImplementedError |
| | 160 | |
| | 161 | def check_password(self, raw_password): |
| | 162 | raise NotImplementedError |
| | 163 | |
| | 164 | def groups(self): |
| | 165 | raise NotImplementedError |
| | 166 | |
| | 167 | def user_permissions(self): |
| | 168 | raise NotImplementedError |
| | 169 | |
| | 170 | def has_perm(self, perm): |
| | 171 | raise NotImplementedError |
| | 172 | |
| | 173 | def has_module_perms(self, module): |
| | 174 | raise NotImplementedError |
| | 175 | |
| | 176 | def get_and_delete_messages(self): |
| | 177 | raise NotImplementedError |
| | 178 | |
| | 179 | def is_anonymous(self): |
| | 180 | raise NotImplementedError |
| | 181 | |
| | 182 | def is_authenticated(self): |
| | 183 | raise NotImpelementedError |
| | 184 | |
| | 185 | class User(models.Model, UserClass): |
| | 386 | |
| | 387 | def __init__(self): |
| | 388 | raise NotImplementedError |
| | 389 | |
| | 390 | def __unicode__(self): |
| | 391 | raise NotImplementedError |
| | 392 | |
| | 393 | def __str__(self): |
| | 394 | raise NotImplementedError |
| | 395 | |
| | 396 | def __eq__(self, other): |
| | 397 | raise NotImplementedError |
| | 398 | |
| | 399 | def __ne__(self, other): |
| | 400 | raise NotImplementedError |
| | 401 | |
| | 402 | def __hash__(self): |
| | 403 | raise NotImplementedError |
| | 404 | |
| | 405 | def save(self): |
| | 406 | raise NotImplementedError |
| | 407 | |
| | 408 | def delete(self): |
| | 409 | raise NotImplementedError |
| | 410 | |
| | 411 | def set_password(self, raw_password): |
| | 412 | raise NotImplementedError |
| | 413 | |
| | 414 | def check_password(self, raw_password): |
| | 415 | raise NotImplementedError |
| | 416 | |
| | 417 | def groups(self): |
| | 418 | raise NotImplementedError |
| | 419 | |
| | 420 | def user_permissions(self): |
| | 421 | raise NotImplementedError |
| | 422 | |
| | 423 | def has_perm(self, perm): |
| | 424 | raise NotImplementedError |
| | 425 | |
| | 426 | def has_module_perms(self, module): |
| | 427 | raise NotImplementedError |
| | 428 | |
| | 429 | def get_and_delete_messages(self): |
| | 430 | raise NotImplementedError |
| | 431 | |
| | 432 | def is_anonymous(self): |
| | 433 | raise NotImplementedError |
| | 434 | |
| | 435 | def is_authenticated(self): |
| | 436 | raise NotImpelementedError |
| | 437 | |
| | 438 | |
| | 439 | class AnonymousUser(UserClass): |
| | 440 | id = None |
| | 441 | username = '' |
| | 442 | is_staff = False |
| | 443 | is_active = True |
| | 444 | is_superuser = False |