Merge lp:~thisfred/u1db/u1todo-example-1 into lp:u1db
Proposed by
Eric Casteleijn
on 2012-04-18
| Status: | Merged |
|---|---|
| Approved by: | Eric Casteleijn on 2012-04-19 |
| Approved revision: | 248 |
| Merged at revision: | 249 |
| Proposed branch: | lp:~thisfred/u1db/u1todo-example-1 |
| Merge into: | lp:u1db |
| Diff against target: |
244 lines (+229/-0) 2 files modified
u1todo/test_u1todo.py (+118/-0) u1todo/u1todo.py (+111/-0) |
| To merge this branch: | bzr merge lp:~thisfred/u1db/u1todo-example-1 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Lucio Torre (community) | 2012-04-18 | Approve on 2012-04-18 | |
|
Review via email:
|
|||
Description of the Change
This has no UI yet, but is the bare bones back end of an application that will store todo items.
To post a comment you must log in.
| Lucio Torre (lucio.torre) wrote : | # |
| Eric Casteleijn (thisfred) wrote : | # |
suggested fixes applied
lp:~thisfred/u1db/u1todo-example-1
updated
on 2012-04-18
- 246. By Eric Casteleijn on 2012-04-18
-
refactored to remove side effects from init, and make store responsible for creating, getting and saving tasks.
- 247. By Eric Casteleijn on 2012-04-18
-
Took the initialization step out of the init.
- 248. By Eric Casteleijn on 2012-04-18
-
removed _trial_temp
review:
Approve

1- i am not comfortable with all init methods having side effects. This code for example looks strange: are_added( self): n('foo' , dict(self. db.list_ indexes( ))) 'foo', dict(self. db.list_ indexes( )))
27 + def test_indexes_
28 + """New indexes are added when a new store is created."""
29 + TodoStore(self.db)
30 + INDEXES['foo'] = ['bar']
31 + self.assertNotI
32 + TodoStore(self.db)
33 + self.assertIn(
Maybe we should have factories that create the objects.
2- There is no relation between the todoStore and the Tasks, which make me thing that there no need for the todo store. If we move to having no side effects on init, we could have store.get() and store.new() to produce the desired side effects.