Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

services.py 440B

123456789101112131415161718
  1. from oscar.core.loading import get_model
  2. Notification = get_model('customer', 'Notification')
  3. def notify_user(user, msg, **kwargs):
  4. """
  5. Send a simple notification to a user
  6. """
  7. Notification.objects.create(recipient=user, subject=msg, **kwargs)
  8. def notify_users(users, msg, **kwargs):
  9. """
  10. Send a simple notification to an iterable of users
  11. """
  12. for user in users:
  13. notify_user(user, msg, **kwargs)