Hi.I have a problem with my filter. I want to filter date and time but
filter is not working.I am sending my models.py

from django.db import models
from datetime import datetime
from datetime import date
from datetime import time
class Randevu(models.Model):
    def __unicode__(self):
        Randevu.objects.all()
        fil=Randevu.objects.filter(date=self.date)
        fil2=fil.filter(time=self.time)

        if fil2!=None:
            print"Error"

        return u'%s %s' % (self.name, self.surname)



    choice = (
        ('08:00', ('08')),
        ('09:00', ('09')),
        ('10:00', ('10')),
        ('11:00', ('11')),
        ('13:00', ('13')),
        ('14:00', ('14')),
        ('15:00', ('15')),
        ('16:00', ('16')),
            )

    name = models.CharField(max_length=30,verbose_name="Name")
    surname = models.CharField(max_length=30,verbose_name="Surname")
    date = models.DateField(verbose_name="Date")
    time = models.TimeField(choices = choice,verbose_name="Time")
    subject = models.TextField(verbose_name="Subject")
    email = models.EmailField(verbose_name="Electronic Address")


#Daybreakers
# Create your models here.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to