coding style: move class attributes (#30752)
This commit is contained in:
parent
504de3b096
commit
17bce30be9
|
@ -45,6 +45,27 @@ class Context(object):
|
|||
|
||||
|
||||
class WcsOlapFeeder(object):
|
||||
|
||||
channels = [
|
||||
[1, 'web', u'web'],
|
||||
[2, 'mail', u'courrier'],
|
||||
[3, 'phone', u'téléphone'],
|
||||
[4, 'counter', u'guichet'],
|
||||
[5, 'backoffice', u'backoffice'],
|
||||
[6, 'email', u'email'],
|
||||
[7, 'fax', u'fax'],
|
||||
]
|
||||
channel_to_id = dict((c[1], c[0]) for c in channels)
|
||||
id_to_channel = dict((c[0], c[1]) for c in channels)
|
||||
|
||||
status = [
|
||||
[1, 'Nouveau'],
|
||||
[2, 'En cours'],
|
||||
[3, 'Terminé'],
|
||||
]
|
||||
status_to_id = dict((c[1], c[0]) for c in channels)
|
||||
id_to_status = dict((c[0], c[1]) for c in channels)
|
||||
|
||||
def __init__(self, api, pg_dsn, schema, logger=None, config=None, do_feed=True, fake=False):
|
||||
self.api = api
|
||||
self.fake = fake
|
||||
|
@ -310,26 +331,6 @@ CREATE TABLE public.dates AS (SELECT
|
|||
generate_series('2010-01-01'::date, '2020-01-01'::date, '1 day'::interval)
|
||||
AS the_date(the_date));''')
|
||||
|
||||
channels = [
|
||||
[1, 'web', u'web'],
|
||||
[2, 'mail', u'courrier'],
|
||||
[3, 'phone', u'téléphone'],
|
||||
[4, 'counter', u'guichet'],
|
||||
[5, 'backoffice', u'backoffice'],
|
||||
[6, 'email', u'email'],
|
||||
[7, 'fax', u'fax'],
|
||||
]
|
||||
channel_to_id = dict((c[1], c[0]) for c in channels)
|
||||
id_to_channel = dict((c[0], c[1]) for c in channels)
|
||||
|
||||
status = [
|
||||
[1, 'Nouveau'],
|
||||
[2, 'En cours'],
|
||||
[3, 'Terminé'],
|
||||
]
|
||||
status_to_id = dict((c[1], c[0]) for c in channels)
|
||||
id_to_status = dict((c[0], c[1]) for c in channels)
|
||||
|
||||
def create_table(self, name, columns, inherits=None, comment=None):
|
||||
sql = 'CREATE TABLE %s' % name
|
||||
sql += '(' + ', '.join('%s %s' % (n, t) for n, t in columns) + ')'
|
||||
|
|
Loading…
Reference in New Issue