You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
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
David
unread,
Nov 4, 2009, 1:28:26 PM11/4/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
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
Ramiro Morales
unread,
Nov 4, 2009, 3:03:01 PM11/4/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
On Wed, Nov 4, 2009 at 2:52 PM, David <cth...@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.