Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
unique_for_date
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Alessandro Ronchi  
View profile  
 More options Nov 4, 10:47 pm
From: Alessandro Ronchi <alessandro.ron...@soasi.com>
Date: Wed, 4 Nov 2009 12:47:34 +0100
Local: Wed, Nov 4 2009 10:47 pm
Subject: unique_for_date
unique_for_date checks only the date in a datetime field or also for the time?

--
Alessandro Ronchi

SOASI
Sviluppo Software e Sistemi Open Source
http://www.soasi.com
http://www.linkedin.com/in/ronchialessandro


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David  
View profile  
 More options Nov 5, 4:52 am
From: David <cthl...@googlemail.com>
Date: Wed, 4 Nov 2009 09:52:22 -0800 (PST)
Local: Thurs, Nov 5 2009 4:52 am
Subject: unique_for_date
Hello

I was wondering if unique_for_date is not working or if I am not
understanding how it is meant to be used.

My model:

class Entry(models.Model):
    title = models.CharField(max_length=255)
    content = models.TextField()
    pubDate = models.DateTimeField(auto_now=False,auto_now_add=True)
    editDate = models.DateTimeField(auto_now=True)
    published = models.BooleanField()
    slug = models.SlugField(unique_for_date='pubDate')
    blog = models.ForeignKey(Blog)
    def __unicode__(self):
        return self.title

When I am in django admin I am able to make multiple entries with the
same slug. I've tried changing the uniqueness to title and both and it
still allowed me to create multiple entries.

Thank you


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David  
View profile  
 More options Nov 5, 5:28 am
From: David <cthl...@googlemail.com>
Date: Wed, 4 Nov 2009 10:28:26 -0800 (PST)
Local: Thurs, Nov 5 2009 5:28 am
Subject: Re: unique_for_date
Hi Alessandro

I just tried converting pubDate to a DateField and it didn't solve the
problem.

Does unique_for_date apply to only the admin interface ? Or, just
everything else ?

I am testing this purely with the admin interface.

Thanks


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ramiro Morales  
View profile  
 More options Nov 5, 7:03 am
From: Ramiro Morales <cra...@gmail.com>
Date: Wed, 4 Nov 2009 17:03:01 -0300
Local: Thurs, Nov 5 2009 7:03 am
Subject: Re: unique_for_date

On Wed, Nov 4, 2009 at 2:52 PM, David <cthl...@googlemail.com> wrote:

> Hello

> I was wondering if unique_for_date is not working or if I am not
> understanding how it is meant to be used.

What version of Django are you using?

--
Ramiro Morales  |  http://rmorales.net


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David  
View profile  
 More options Nov 5, 7:43 am
From: David <cthl...@googlemail.com>
Date: Wed, 4 Nov 2009 12:43:44 -0800 (PST)
Local: Thurs, Nov 5 2009 7:43 am
Subject: Re: unique_for_date
Hi Ramiro

I'm using Django 1.1.1


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google