Skip to content

Commit 4174506

Browse files
authored
Update README.md
1 parent 1710927 commit 4174506

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,24 @@ __Update__:
2626
and apply the updates to the appropriate table in the database
2727

2828
```python
29-
@updateAfterEvent
30-
def method1(self, args...):
31-
...
32-
return self
33-
34-
@updateAfterEvent
35-
def method2(self, obj_2, args ...):
36-
...
37-
return obj_2
29+
from utils import updateAfterEvent
30+
...
31+
class foo:
32+
@updateAfterEvent
33+
def method1(self, args...):
34+
...
35+
return self
36+
37+
@updateAfterEvent
38+
def method2(self, obj_2, args ...):
39+
...
40+
return obj_2
3841
```
39-
* You can put the decorator in a separate file then import it wherever you'll be using it (Ex: `pokemonApp/mytools/utils.py`)
42+
* You can put the decorator in a separate file then import it wherever you'll be using it (Ex: `utils.py`)
4043

4144
> Manual update
4245
43-
You can use the function `updateObj` (defined also in `pokemonApp/mytools/utils.py`):
46+
You can use the function `updateObj` (defined in `utils.py`):
4447
```python
4548
from utils import updateObj
4649
obj_.attr += 10

0 commit comments

Comments
 (0)