Commit f53a10aaffbb577352a97b225adbf195fb277e72

Authored by Andrew Buss
1 parent 057d2cc3f7
Exists in master

add django-extensions

Showing 4 changed files with 7 additions and 10 deletions Side-by-side Diff

flashcards/models.py View file @ f53a10a
... ... @@ -88,7 +88,7 @@
88 88 import flashcards.notifications
89 89  
90 90 flashcards.notifications.notify_score_change(flashcard)
91   - flashcards.notifications.deck_card_score_change(flashcard)
  91 + flashcards.notifications.notify_pull(flashcard)
92 92  
93 93 def unpull(self, flashcard):
94 94 if not self.is_in_section(flashcard.section):
flashcards/notifications.py View file @ f53a10a
... ... @@ -20,17 +20,10 @@
20 20 message = RedisMessage(ws_message)
21 21 redis_publisher.publish_message(message)
22 22  
23   -# def tell all clients the score changed
24   - # you added a card
25   - #
26   -def deck_card_score_change(flashcard):
  23 +def notify_pull(flashcard):
27 24 redis_publisher = RedisPublisher(facility='deck/%d' % flashcard.section_id, users=[SELF])
28 25 ws_message = JSONRenderer().render(
29 26 {'event_type': 'pull_card', 'flashcard': serializers.FlashcardSerializer(flashcard).data})
30 27 message = RedisMessage(ws_message)
31 28 redis_publisher.publish_message(message)
32   -
33   -
34   -
35   -# def hiding stuff
flashy/settings.py View file @ f53a10a
... ... @@ -27,8 +27,10 @@
27 27 'django.contrib.messages',
28 28 'django.contrib.staticfiles',
29 29 'ws4redis',
  30 +
30 31 'rest_framework_swagger',
31 32 'rest_framework',
  33 + 'django_extensions',
32 34 ]
33 35  
34 36 WEBSOCKET_URL = '/ws/'
requirements.txt View file @ f53a10a
... ... @@ -12,4 +12,5 @@
12 12 coverage
13 13 django-rest-swagger
14 14 pytz
  15 +django-extensions