-
Notifications
You must be signed in to change notification settings - Fork 0
/
DIARY.txt
67 lines (35 loc) · 2.14 KB
/
DIARY.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
* 24.nov.16
A few days ago I initially worked on Transactions first. The Transaction Form is most verbose, and because amount is an IntegerField, I need a CharField to convert back and forth between amounts in cents or in whole amounts (dollars and cents).
ModelForms do all the work for you.
The last model I worked on was Account: Create and saveCreate
* 24.nov.16
Starting a new app to correct some of the mistakes in Alexie. Will call it benny (after Benjamin Franklin)
$ python manage.py startapp benny
Edit minialexie/settings.py, add benny to INSTALLED_APPS
Edit models.py
$ python manage.py makemigrations
$ python manage.py migrate
Using exactly the same names in benny creates clashes with existing alexie models. I added related_names to alexie models, then re-ran the migrations.
Edit admin.py
Added default value of Decimal(0) to Account.budget
Wrote tests for benny, adding zero, one, and two transactions
Added r'^benny/' as an url in minialexie/urls.py. Had to restart server.
Rewrote index, no need for templatetags like alexie's index
Compute balances in time period in view, because we cannot call functions with arguments in the template
Compute percentage spent in view, display as a fraction, like Alexie Beans
* 24.nov.16 night (Ubuntu)
Copied URLs from alexie to benny and stubbed views (defined function names and added 'pass' only)
Copied base.html from alexie to benny
Created AccountType Create, Update, and related Save views
reverse can take arguments as kwargs (see accountTypeSaveUpdate)
Copied and updated progress table in views.py
* 26.nov.16
Created a new app "nov26" in alicedj for trying out class-based views
Following the topic "Class-based views"
https://docs.djangoproject.com/en/1.10/topics/class-based-views/
List view can be restricted to user's objects within the view
When editing the form in a CreateView, use form_class=None to avoid a TypeError "missing 1 required positional argument". It is also written like that in the documentation.
https://docs.djangoproject.com/en/1.10/ref/class-based-views/mixins-editing/
Added get_absolute_url to Account model
* 27.nov.16
Bogus data for demo account in models.py