Permalink
Browse files

pep8 fix

  • Loading branch information...
Stefano Parmesan
Stefano Parmesan committed Mar 9, 2012
1 parent 0a8349d commit b287a582310d3484167b9ca8d00e0d83926d87f9
View
@@ -3,8 +3,8 @@
def dummy_for_makemessages():
"""
- This function allows manage makemessages to find the forecast types for translation.
- Removing this code causes makemessages to comment out those PO entries, so don't do that
- unless you find a better way to do this
+ This function allows manage makemessages to find the forecast types
+ for translation. Removing this code causes makemessages to comment out
+ those PO entries, so don't do that unless you find a better way to do this
"""
_('Owned')
@@ -1 +1 @@
-# empty file
+# empty file
@@ -15,12 +15,12 @@
DATABASES = {
'default': {
- 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
- 'NAME': 'bandbook', # Or path to database file if using sqlite3.
- 'USER': 'bandbook', # Not used with sqlite3.
- 'PASSWORD': 'b@ndb00k', # Not used with sqlite3.
- 'HOST': '127.0.0.1', # Set to empty string for localhost. Not used with sqlite3.
- 'PORT': '5432', # Set to empty string for default. Not used with sqlite3.
+ 'ENGINE': 'django.db.backends.postgresql_psycopg2',
+ 'NAME': 'bandbook',
+ 'USER': 'bandbook',
+ 'PASSWORD': 'b@ndb00k',
+ 'HOST': '127.0.0.1',
+ 'PORT': '5432',
}
}
@@ -124,7 +124,8 @@
ROOT_URLCONF = 'bandbook.urls'
TEMPLATE_DIRS = (
- # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
+ # Put strings here, like "/home/html/django_templates" or
+ # "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
@@ -2,11 +2,11 @@
DATABASES = {
'default': {
- 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
- 'NAME': 'bandbook', # Or path to database file if using sqlite3.
- 'USER': 'postgres', # Not used with sqlite3.
- 'PASSWORD': '', # Not used with sqlite3.
- 'HOST': '127.0.0.1', # Set to empty string for localhost. Not used with sqlite3.
- 'PORT': '5432', # Set to empty string for default. Not used with sqlite3.
+ 'ENGINE': 'django.db.backends.postgresql_psycopg2',
+ 'NAME': 'bandbook',
+ 'USER': 'postgres',
+ 'PASSWORD': '',
+ 'HOST': '127.0.0.1',
+ 'PORT': '5432',
}
}
@@ -1,7 +1,8 @@
import reversion
from django.contrib import admin
-from bandbook.instruments.models import InstrumentCategory, Instrument, InstrumentType, InstrumentManufacturer, InstrumentModel, InstrumentHistory
+from bandbook.instruments.models import InstrumentCategory, Instrument, \
+ InstrumentType, InstrumentManufacturer, InstrumentModel, InstrumentHistory
class InstrumentCategoryAdmin(reversion.VersionAdmin):
@@ -32,7 +33,8 @@ class InstrumentAdmin(reversion.VersionAdmin):
class InstrumentHistoryAdmin(reversion.VersionAdmin):
- list_display = ['instrument', 'get_event', 'date_start', 'date_end', 'target']
+ list_display = ['instrument', 'get_event', 'date_start',
+ 'date_end', 'target']
admin.site.register(InstrumentCategory, InstrumentCategoryAdmin)
@@ -5,7 +5,8 @@
from django.forms.widgets import HiddenInput, Textarea
from django.forms import ModelChoiceField, ChoiceField
from bandbook.instruments.helpers import get_default_ordering
-from bandbook.instruments.models import Instrument, InstrumentHistory, InstrumentCategory, InstrumentType
+from bandbook.instruments.models import Instrument, InstrumentHistory, \
+ InstrumentCategory, InstrumentType
from bandbook.instruments.handlers.instrument_history import site
from bandbook.main.widgets import BootstrapDatepicker
from bandbook.players.models import Player
@@ -57,8 +58,8 @@ class Meta:
'instrument': HiddenInput(),
'content_type': HiddenInput(),
'object_id': HiddenInput(),
- 'condition': Textarea(attrs={'rows':2, 'class': 'span4'}),
- 'notes': Textarea(attrs={'rows':2, 'class': 'span4'}),
+ 'condition': Textarea(attrs={'rows': 2, 'class': 'span4'}),
+ 'notes': Textarea(attrs={'rows': 2, 'class': 'span4'}),
}
def __init__(self, *args, **kwargs):
@@ -19,6 +19,7 @@ class InstrumentCategory(TimeStampedModel):
unique=True, editable=False)
search_by = ('name', 'instrumenttype__name')
+
class Meta:
ordering = ['ordering']
verbose_name_plural = "Instrument categories"
@@ -29,13 +30,15 @@ def __unicode__(self):
class InstrumentType(TimeStampedModel):
name = models.CharField(max_length=64, verbose_name=_("Name"))
- category = models.ForeignKey(InstrumentCategory, verbose_name=_("Category"))
+ category = models.ForeignKey(InstrumentCategory,
+ verbose_name=_("Category"))
ordering = models.IntegerField(editable=False,
default=-1, verbose_name=_("Ordering"))
slug = AutoSlugField('slug', populate_from='name',
unique=True, editable=False)
parent_model = ('category', InstrumentCategory)
+
class Meta:
ordering = ['ordering']
@@ -48,8 +51,10 @@ class InstrumentManufacturer(TimeStampedModel):
slug = AutoSlugField('slug', populate_from='name',
unique=True, editable=False)
- search_by = ('name', 'instrumentmodel__name', 'instrumentmodel__type__name',
+ search_by = ('name', 'instrumentmodel__name',
+ 'instrumentmodel__type__name',
'instrumentmodel__type__category__name')
+
class Meta:
ordering = ['name']
@@ -66,6 +71,7 @@ class InstrumentModel(TimeStampedModel):
unique=True, editable=False)
parent_model = ('manufacturer', InstrumentManufacturer)
+
class Meta:
ordering = ['type__ordering']
@@ -82,6 +88,7 @@ class Instrument(TimeStampedModel):
search_by = ('code', 'model__name', 'model__manufacturer__name',
'model__type__name', 'model__type__category__name', )
+
class Meta:
ordering = ['model__type__ordering']
@@ -97,7 +104,8 @@ def get_status(self):
def get_condition(self):
try:
return self.instrumenthistory_set.filter(~Q(condition=None) &
- ~Q(condition=''))[0].condition
+ ~Q(condition=''))[0]\
+ .condition
except IndexError:
return _('---')
@@ -111,14 +119,16 @@ class InstrumentHistory(TimeStampedModel):
date_start = models.DateField(verbose_name=_("From"))
date_end = models.DateField(blank=True, null=True, verbose_name=_("To"))
event_id = models.IntegerField(verbose_name=_("Event"))
- condition = models.TextField(blank=True, default='', verbose_name=_("Condition"))
+ condition = models.TextField(blank=True, default='',
+ verbose_name=_("Condition"))
notes = models.TextField(blank=True, default='', verbose_name=_("Notes"))
content_type = models.ForeignKey(ContentType, blank=True, null=True)
object_id = models.PositiveIntegerField(blank=True, null=True)
target = GenericForeignKey('content_type', 'object_id')
parent_model = ('instrument', Instrument)
+
class Meta:
ordering = ['-date_start']
Oops, something went wrong.

0 comments on commit b287a58

Please sign in to comment.