def usuarioNotificaciones(id_usuario): ishoutclient = iShoutClient() ishoutclient.emit( id_usuario, 'notificaciones', data={'msg': 'Tu saldo disponible es Bs 00.00', 'type': 'danger'} )
def usuarioNotificaciones(id_usuario): ishoutclient = iShoutClient() ishoutclient.emit(id_usuario, 'notificaciones', data={ 'msg': 'Tu saldo disponible es Bs 00.00', 'type': 'danger' })
def adminNotificaciones(): administradores = Usuario.objects.filter(is_staff=True) ishoutclient = iShoutClient() for admin in administradores: ishoutclient.emit(admin.id, 'notificaciones', data={ 'msg': 'Al usuario pepe le queda de saldo Bs 00.00', 'type': 'danger' })
def adminNotificaciones(): administradores = Usuario.objects.filter(is_staff=True) ishoutclient = iShoutClient() for admin in administradores: ishoutclient.emit( admin.id, 'notificaciones', data={ 'msg': 'Al usuario pepe le queda de saldo Bs 00.00', 'type': 'danger' } )
from django.template import RequestContext, Context from django.template.loader import get_template, render_to_string from django.utils.timezone import utc from django.core.mail import send_mail from django.contrib.auth.models import User from customauth.models import CustomUser from django.views.decorators.cache import cache_control from django.views.decorators.csrf import csrf_exempt from django.contrib.auth.decorators import login_required, user_passes_test from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, HttpResponse, HttpResponseForbidden, HttpResponseBadRequest from drealtime import iShoutClient from productos.models import Producto from licoreras.models import Licorera from .models import Cliente, Orden, Ordenrelacion, Cupon, Cuponrelacion, Rechazo ishout_client = iShoutClient() def home(request): return render_to_response("index.html",) @cache_control(no_cache=True, must_revalidate=True, no_store=True) def login_success(request): if request.user.groups.filter(name="Licoreras").exists(): users = CustomUser.objects.exclude(id=request.user.id) variables = RequestContext(request,{'users':users}) return redirect(pedidos) else: return redirect(compras) @csrf_exempt def registrarorden(request):
from __future__ import unicode_literals from django.shortcuts import render from django.template import RequestContext from django.contrib.auth.models import User from django.contrib.auth import logout from django.shortcuts import redirect from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from example.models import ChatSession from example.models import ChatLog from django.db.models import Q from drealtime import iShoutClient ishout_client = iShoutClient() # Create your views here. @login_required(login_url='/accounts/login/') def home(request): users = User.objects.exclude(id=request.user.id) channel = ChatSession.objects.get( id=1) #CHANGE WITH PARAMETER GET Using token!! logs = ChatLog.objects.filter(session_id=channel.id).select_related() return render( request, 'home.html', { 'users': users, 'username': request.user.username, 'user_id': request.user.id,