# Path: helpdesk/models.py
# class Complaint(models.Model):
#     """
#     complaint model for help desk
#     """
#     title = models.CharField(max_length=64, verbose_name=_('Title'))
#     detail = models.TextField(verbose_name=_('Detail'))
#     sender = models.ForeignKey(User, related_name='Sender')
#     to = models.ForeignKey(User, related_name='To')
#     date = models.DateTimeField(auto_now_add=True, verbose_name=_('Date'))
#     is_active = models.BooleanField(default=True, verbose_name=_('Pending'))
# 
#     def __unicode__(self):
#         return self.title
# 
# Path: pos/models.py
# class Transaction(models.Model):
# 	"""
# 	model for transactions
# 	"""
# 	customer = models.ForeignKey(Customer)	
# 	staff = models.ForeignKey(Staff)
# 	product = models.ForeignKey(Product)
# 	# time stamps !
# 	created_at = models.DateTimeField(auto_now_add=True, verbose_name=_('Created at'))
# 
# 	wholesale_price = models.CharField(max_length=128, verbose_name=_('Wholesale Price'))	
# 	retail_price = models.CharField(max_length=128, verbose_name=_('Retail Price'))
# 	other_details = models.CharField(max_length=1024, verbose_name=_('Other Details'))
# 
# 	def __unicode__(self):
# 		"""
# 		function returns unicode representation of 
# 		"""
# 		return "%s" % self.product


from django.shortcuts import render
from django.shortcuts import render_to_response
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.template.context_processors import csrf
from django.http import HttpResponseRedirect
from django.template import RequestContext
from helpdesk.models import Complaint
from pos.models import Transaction
from dashboard.forms import LoginForm




@login_required
def home(request):	
    pending_complaints_count = Complaint.objects.filter(is_active=True).count()

# Path: helpdesk/models.py
# class Complaint(models.Model):
#     """
#     complaint model for help desk
#     """
#     title = models.CharField(max_length=64, verbose_name=_('Title'))
#     detail = models.TextField(verbose_name=_('Detail'))
#     sender = models.ForeignKey(User, related_name='Sender')
#     to = models.ForeignKey(User, related_name='To')
#     date = models.DateTimeField(auto_now_add=True, verbose_name=_('Date'))
#     is_active = models.BooleanField(default=True, verbose_name=_('Pending'))
# 
#     def __unicode__(self):
#         return self.title
# 
# Path: pos/models.py
# class Transaction(models.Model):
# 	"""
# 	model for transactions
# 	"""
# 	customer = models.ForeignKey(Customer)	
# 	staff = models.ForeignKey(Staff)
# 	product = models.ForeignKey(Product)
# 	# time stamps !
# 	created_at = models.DateTimeField(auto_now_add=True, verbose_name=_('Created at'))
# 
# 	wholesale_price = models.CharField(max_length=128, verbose_name=_('Wholesale Price'))	
# 	retail_price = models.CharField(max_length=128, verbose_name=_('Retail Price'))
# 	other_details = models.CharField(max_length=1024, verbose_name=_('Other Details'))
# 
# 	def __unicode__(self):
# 		"""
# 		function returns unicode representation of 
# 		"""
# 		return "%s" % self.product


# Path: dashboard/views.py
from django.shortcuts import render
from django.shortcuts import render_to_response
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.template.context_processors import csrf
from django.http import HttpResponseRedirect
from django.template import RequestContext
from helpdesk.models import Complaint
from pos.models import Transaction
from dashboard.forms import LoginForm





@login_required
def home(request):	
    pending_complaints_count = Complaint.objects.filter(is_active=True).count()

    total_complaints_count = Complaint.objects.all().count()