Project

General

Profile

« Previous | Next » 

Revision 3c5df84d

Added by Jérôme Schneider about 10 years ago

cleanning code: fix some pylints warning like useless imports

View differences:

calebasse/actes/models.py
4 4
from django.db import models
5 5
from django.contrib.auth.models import User
6 6

  
7
import reversion
8

  
9
from calebasse.agenda.models import Event, EventType
10
from calebasse.agenda.managers import EventManager
7
from calebasse.actes.validation_states import VALIDATION_STATES
11 8
from calebasse.ressources.models import ServiceLinkedAbstractModel
12 9
from ..middleware.request import get_request
13 10

  
14
from validation_states import VALIDATION_STATES, NON_VALIDE
15

  
16 11

  
17 12
class ActValidationState(models.Model):
18 13

  
calebasse/actes/views.py
4 4

  
5 5
from django.http import HttpResponseRedirect, HttpResponse
6 6
from django.db.models import Q
7
from django.views.generic.edit import ModelFormMixin
8 7
from django.shortcuts import redirect
9 8

  
10
from calebasse.cbv import ListView, UpdateView, FormView, DeleteView
9
from calebasse.cbv import ListView, UpdateView, DeleteView
11 10
from calebasse.agenda.views import NewAppointmentView
12 11

  
13 12
import copy
......
20 19
            service=service)
21 20

  
22 21
class ActListingView(ListView):
23
    model=models.Act
24
    template_name='actes/act_listing.html'
22
    model = models.Act
23
    template_name = 'actes/act_listing.html'
25 24

  
26 25
    def get_queryset(self):
27 26
        qs = super(ActListingView, self).get_queryset()
calebasse/agenda/models.py
75 75
            (4, 'Une semaine sur quatre'),
76 76
            (5, 'Une semaine sur cinq')
77 77
    )
78
    OFFSET = range(0,4)
78
    OFFSET = range(0, 4)
79 79
    PERIODICITIES = (
80 80
            (1, u'Toutes les semaines'),
81 81
            (2, u'Une semaine sur deux'),
calebasse/dossiers/models.py
7 7
from dateutil.relativedelta import relativedelta
8 8
from cPickle import loads, dumps
9 9

  
10
from django import forms
11 10
from django.conf import settings
12 11
from django.db import models
13 12
from django.db.models import Min, Max, Q
......
16 15

  
17 16
import reversion
18 17

  
19
from calebasse.choices import (LARGE_REGIME_CHOICES, TYPE_OF_CONTRACT_CHOICES,
20
        DEFICIENCY_CHOICES)
18
from calebasse.choices import TYPE_OF_CONTRACT_CHOICES, DEFICIENCY_CHOICES
21 19
from calebasse.models import PhoneNumberField, ZipCodeField
22 20
from calebasse.personnes.models import People
23 21
from calebasse.ressources.models import (ServiceLinkedAbstractModel,
24
        NamedAbstractModel, Service)
25
from calebasse.actes.validation import are_all_acts_of_the_day_locked
22
        NamedAbstractModel)
26 23
from calebasse.actes.models import Act
27 24

  
28 25
DEFAULT_ACT_NUMBER_DIAGNOSTIC = 6
......
655 652
            except IndexError:
656 653
                pass
657 654
            else:
658
                 if os.path.exists(fullpath) and not os.path.exists(next_fullpath):
659
                     os.rename(fullpath, next_fullpath)
660
                 continue
655
                if os.path.exists(fullpath) and not os.path.exists(next_fullpath):
656
                    os.rename(fullpath, next_fullpath)
657
                continue
661 658
            if not os.path.exists(fullpath):
662 659
                os.makedirs(fullpath)
663 660
            for subdir in settings.PATIENT_SUBDIRECTORIES:
......
864 861
        today = date.today()
865 862
        current_hc_trait = None
866 863
        try:
867
            current_hc_trait = CmppHealthCareTreatment.objects.filter(patient=self,start_date__lte=today, end_date__gte=today).latest('start_date')
864
            current_hc_trait = CmppHealthCareTreatment.objects.filter(
865
                patient=self, start_date__lte=today, end_date__gte=today
866
            ).latest('start_date')
868 867
        except:
869 868
            pass
870 869
        if not current_hc_trait:
calebasse/dossiers/views.py
5 5
from datetime import datetime, date
6 6

  
7 7
from django.conf import settings
8
from django.core.urlresolvers import reverse_lazy
9 8
from django.db import models
10 9
from django.http import HttpResponseRedirect, HttpResponse
11 10
from django.views.generic import View
12
from django.views.generic.edit import DeleteView, FormMixin
11
from django.views.generic.edit import DeleteView
13 12
from django.contrib import messages
14 13
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
15 14
from django.core.files import File
......
28 27
        PatientAddress, Status, FileState, create_patient, CmppHealthCareTreatment,
29 28
        CmppHealthCareDiagnostic, SessadHealthCareNotification, HealthCare,
30 29
        TransportPrescriptionLog, ProtectionState)
31
from calebasse.dossiers.states import STATES_MAPPING, STATE_CHOICES_TYPE, STATES_BTN_MAPPER
30
from calebasse.dossiers.states import STATES_MAPPING, STATES_BTN_MAPPER
32 31
from calebasse.ressources.models import (Service,
33 32
    SocialisationDuration, MDPHRequest, MDPHResponse)
34 33
from calebasse.facturation.list_acts import list_acts_for_billing_CMPP_per_patient
calebasse/lookups.py
4 4

  
5 5
class CalebasseLookup(LookupChannel):
6 6

  
7
    def check_auth(self,request):
7
    def check_auth(self, request):
8 8
        if not request.user.is_authenticated():
9 9
            raise PermissionDenied
10 10

  
calebasse/models.py
15 15
class PhoneNumberField(models.CharField):
16 16
    def __init__(self, *args, **kwargs):
17 17
        kwargs['max_length'] = 20
18
        super(PhoneNumberField, self).__init__(*args,**kwargs)
18
        super(PhoneNumberField, self).__init__(*args, **kwargs)
19 19

  
20 20
    def formfield(self, **kwargs):
21 21
        default = { 'form_class': FRPhoneNumberField }
setup.py
5 5
def get_version():
6 6
    import glob
7 7
    import re
8
    import os
9 8

  
10 9
    version = None
11 10
    for d in glob.glob('*'):

Also available in: Unified diff