Commit 03e53608 authored by Michal Čihař's avatar Michal Čihař

New style classes for Meta classes

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent e69edf66
...@@ -159,7 +159,7 @@ class ProfileForm(forms.ModelForm): ...@@ -159,7 +159,7 @@ class ProfileForm(forms.ModelForm):
''' '''
User profile editing. User profile editing.
''' '''
class Meta: class Meta(object):
model = Profile model = Profile
fields = ( fields = (
'language', 'language',
...@@ -184,7 +184,7 @@ class SubscriptionForm(forms.ModelForm): ...@@ -184,7 +184,7 @@ class SubscriptionForm(forms.ModelForm):
''' '''
User subscription management. User subscription management.
''' '''
class Meta: class Meta(object):
model = Profile model = Profile
fields = ( fields = (
'subscriptions', 'subscriptions',
...@@ -225,7 +225,7 @@ class UserForm(forms.ModelForm): ...@@ -225,7 +225,7 @@ class UserForm(forms.ModelForm):
required=True required=True
) )
class Meta: class Meta(object):
model = User model = User
fields = ( fields = (
'username', 'username',
......
...@@ -294,7 +294,7 @@ class Language(models.Model, PercentMixin): ...@@ -294,7 +294,7 @@ class Language(models.Model, PercentMixin):
objects = LanguageManager() objects = LanguageManager()
class Meta: class Meta(object):
ordering = ['name'] ordering = ['name']
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
......
...@@ -194,7 +194,7 @@ class Change(models.Model): ...@@ -194,7 +194,7 @@ class Change(models.Model):
objects = ChangeManager() objects = ChangeManager()
class Meta: class Meta(object):
ordering = ['-timestamp'] ordering = ['-timestamp']
app_label = 'trans' app_label = 'trans'
......
...@@ -124,7 +124,7 @@ class Dictionary(models.Model): ...@@ -124,7 +124,7 @@ class Dictionary(models.Model):
objects = DictionaryManager() objects = DictionaryManager()
class Meta: class Meta(object):
ordering = ['source'] ordering = ['source']
permissions = ( permissions = (
('upload_dictionary', "Can import dictionary"), ('upload_dictionary', "Can import dictionary"),
......
...@@ -182,7 +182,7 @@ class Project(models.Model, PercentMixin, URLMixin, PathMixin): ...@@ -182,7 +182,7 @@ class Project(models.Model, PercentMixin, URLMixin, PathMixin):
is_git_lockable = True is_git_lockable = True
class Meta: class Meta(object):
ordering = ['name'] ordering = ['name']
app_label = 'trans' app_label = 'trans'
......
...@@ -26,7 +26,7 @@ class IndexUpdate(models.Model): ...@@ -26,7 +26,7 @@ class IndexUpdate(models.Model):
unit = models.ForeignKey(Unit) unit = models.ForeignKey(Unit)
source = models.BooleanField(default=True) source = models.BooleanField(default=True)
class Meta: class Meta(object):
app_label = 'trans' app_label = 'trans'
def __unicode__(self): def __unicode__(self):
......
...@@ -28,6 +28,6 @@ class Source(models.Model): ...@@ -28,6 +28,6 @@ class Source(models.Model):
subproject = models.ForeignKey(SubProject) subproject = models.ForeignKey(SubProject)
timestamp = models.DateTimeField(auto_now_add=True) timestamp = models.DateTimeField(auto_now_add=True)
class Meta: class Meta(object):
app_label = 'trans' app_label = 'trans'
unique_together = ('checksum', 'subproject') unique_together = ('checksum', 'subproject')
...@@ -243,7 +243,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin): ...@@ -243,7 +243,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
is_git_lockable = True is_git_lockable = True
class Meta: class Meta(object):
ordering = ['project__name', 'name'] ordering = ['project__name', 'name']
unique_together = ( unique_together = (
('project', 'name'), ('project', 'name'),
......
...@@ -146,7 +146,7 @@ class Translation(models.Model, URLMixin, PercentMixin): ...@@ -146,7 +146,7 @@ class Translation(models.Model, URLMixin, PercentMixin):
is_git_lockable = False is_git_lockable = False
class Meta: class Meta(object):
ordering = ['language__name'] ordering = ['language__name']
permissions = ( permissions = (
('upload_translation', "Can upload translation"), ('upload_translation', "Can upload translation"),
......
...@@ -320,7 +320,7 @@ class Unit(models.Model): ...@@ -320,7 +320,7 @@ class Unit(models.Model):
objects = UnitManager() objects = UnitManager()
class Meta: class Meta(object):
permissions = ( permissions = (
('save_translation', "Can save translation"), ('save_translation', "Can save translation"),
) )
......
...@@ -114,7 +114,7 @@ class Suggestion(models.Model, RelatedUnitMixin): ...@@ -114,7 +114,7 @@ class Suggestion(models.Model, RelatedUnitMixin):
objects = SuggestionManager() objects = SuggestionManager()
class Meta: class Meta(object):
permissions = ( permissions = (
('accept_suggestion', "Can accept suggestion"), ('accept_suggestion', "Can accept suggestion"),
('override_suggestion', 'Can override suggestion state'), ('override_suggestion', 'Can override suggestion state'),
...@@ -204,7 +204,7 @@ class Vote(models.Model): ...@@ -204,7 +204,7 @@ class Vote(models.Model):
user = models.ForeignKey(User) user = models.ForeignKey(User)
positive = models.BooleanField(default=True) positive = models.BooleanField(default=True)
class Meta: class Meta(object):
unique_together = ('suggestion', 'user') unique_together = ('suggestion', 'user')
app_label = 'trans' app_label = 'trans'
...@@ -271,7 +271,7 @@ class Comment(models.Model, RelatedUnitMixin): ...@@ -271,7 +271,7 @@ class Comment(models.Model, RelatedUnitMixin):
objects = CommentManager() objects = CommentManager()
class Meta: class Meta(object):
ordering = ['timestamp'] ordering = ['timestamp']
app_label = 'trans' app_label = 'trans'
...@@ -300,7 +300,7 @@ class Check(models.Model, RelatedUnitMixin): ...@@ -300,7 +300,7 @@ class Check(models.Model, RelatedUnitMixin):
check = models.CharField(max_length=20, choices=CHECK_CHOICES) check = models.CharField(max_length=20, choices=CHECK_CHOICES)
ignore = models.BooleanField(db_index=True) ignore = models.BooleanField(db_index=True)
class Meta: class Meta(object):
permissions = ( permissions = (
('ignore_check', "Can ignore check results"), ('ignore_check', "Can ignore check results"),
) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment