Last active
November 2, 2019 19:18
-
-
Save runekaagaard/469968d8d27330621fb493d962b5d61e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
state = { | |
"users": | |
User.mutable.all() > { | |
"tags": Tag.mutable.up().all(), | |
}, | |
"movie": | |
Movie.mutable.get(pk=91) > { | |
"actors": Actor.mutable.up().all(), | |
"style": Style.mutable.up().get(), | |
} | |
} | |
with mutate(): | |
state.users[5].name = "Mark Mark" | |
state.movie.watched += 1 | |
state.users[1].tags.append(Tag(tag="scify")) | |
del state.movie.actors[4] | |
print state.users[5].did_change() # True | |
print state.users[4].did_change() # False | |
""" | |
{% loop user in state.users <div> %} | |
{{user.email}} | |
{% for tag in user.tags %} | |
<li>{{tag.tag}}</li> | |
{% endfor %} | |
{% endloop %} | |
{% item movie <div> %} | |
{{movie.title}} | |
{% loop actor in movie.actors <li> %} | |
{{actor.name}} | |
{% endloop %} | |
{% enditem %} | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment