-
Notifications
You must be signed in to change notification settings - Fork 28
/
TODO.txt
136 lines (102 loc) · 3.79 KB
/
TODO.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
Instal·lació:
0) [Opcional] Crear virtualenv
1) pip install -r requirements.txt
2) Importar fixtures: ./scripts/fixtures.sh
3) python manage.py runserver
4) anar a Admin / Carrega inicial
#---Crear virtualenv-------------
#https://pypi.python.org/pypi/virtualenv
$ [sudo] pip install virtualenv
virtualenv env
source venv/bin/activate
#---------------------------------
Requeriments SO:
apt-get install libxml2-dev libxslt-dev
#---------------------------------
per postgres::
sudo apt-get build-dep python-psycopg2
pip install psycopg2
psql:
CREATE USER djau2015 WITH PASSWORD 'myPassword';
CREATE DATABASE djau2015;
GRANT ALL PRIVILEGES ON DATABASE djau2015 to djau2015;
#---TODO----------------------
* Nova incidencia -> redirect to / + message
* Pantalla incidències aula ( incidencies/posaIncidenciaAula/ ), refer-la.
*? Settings 'Centre' a demo / customising
* 'Tindré sort': badge amb la problabilitat.
* /admin/incidencies/frassesincidenciaaula
* favicon xulo.
* Càrrega inicial: redirects a la pròpia pantalla + missatges
#-----------------------------
#utils:
my_username = 'coo'
from django.contrib.auth.models import User, Group
g1 = Group.objects.get(name= 'direcció' )
g2 = Group.objects.get(name= 'professors' )
g3 = Group.objects.get(name= 'professional' )
#g4 = Group.objects.get(name= 'administradors' )
#a = User.objects.get( username = my_username , email='[email protected]', password="oletu" )
a = User.objects.get( username = my_username )
a.groups = [ g1, g2, g3 ]
a.save()
quit()
#-- canviar dates del curs totes de cop:
from datetime import date
d1 = date( day=18, month=7, year=2013)
d2 = date( day=18, month=8, year=2013)
from aula.apps.alumnes.models import Curs
for c in Curs.objects.all():
c.data_inici_curs = d1
c.data_fi_curs = d2
c.save()
#--------------
find . -print | grep ".py"$ | xargs -i sed -i.bak s/x/y/g {} > {}
find . -print | grep ".html"$ | xargs -i sed -i.bak s/x/y/g {} > {}
find . -print | grep ".bak"$ | xargs -i rm {}
#------------
Treure tots els commits del desembre:
git filter-branch -f --env-filter \
'case $GIT_COMMIT in
5ad5c6bdde289b0b98992f53d62f8b1aa50d5404 )
echo canviant ;
export GIT_AUTHOR_DATE="Thu Aug 1 00:00:00 2013 -0000";
export GIT_COMMITTER_DATE="Thu Aug 1 00:00:00 2013 -0000";
;;
162e33ade507da4ce280cb11073b996312e00a6c )
echo canviant ;
export GIT_AUTHOR_DATE="Thu Aug 1 00:00:00 2013 -0000";
export GIT_COMMITTER_DATE="Thu Aug 1 00:00:00 2013 -0000";
;;
...
63dc0dca5b2cab28101ed9b598c86143b5efca2d )
echo canviant ;
export GIT_AUTHOR_DATE="Thu Aug 1 00:00:00 2013 -0000";
export GIT_COMMITTER_DATE="Thu Aug 1 00:00:00 2013 -0000";
;;
esac
'
#--- aules ----
*** Atenció: falten proves.
* Faltar provar matxacar reserva a persona per canvis d'aula als horaris i veure les notificacions.
*** Falten missatges si no hi ha franges lliures o aules lliures.
from aula.apps.horaris.models import Horari
from aula.apps.aules.models import Aula
for h in Horari.objects.all():
nom_aula = h.nom_aula
if bool(nom_aula):
aula, _ = Aula.objects.get_or_create( nom_aula = nom_aula )
h.aula = aula
h.save()
n = I.objects.count()
from aula.apps.presencia.models import Impartir as I
for j,i in enumerate(I.objects.all()):
i.save()
if j % (n/50) == 0:
print "[" + " "*(50*j/n) + "*" + " "*(50*(n-j)/n) + "]"
from aula.apps.horaris.models import FranjaHoraria
franges_matins = FranjaHoraria.objects.filter( hora_inici__lte = '14:00' )
zona_matins = list( Aula.objects.filter( nom_aula__startswith = '1' ) )
zona_matins += list( Aula.objects.filter( nom_aula__startswith = '2' ) )
for aula in zona_matins:
aula.disponibilitat_horaria = franges_matins