If you're using the svn version, I would recommend using named URLs.
http://www.djangoproject.com/documentation/url_dispatch/#naming-url-patterns
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
Awesome. Thanks for clearing that up for me.
On Apr 22, 4:12 pm, Michael <[EMAIL PROTECTED]> wrote:
> Thanks. It was something in your models.
>
> Django can't just magically figure out what url you want besed on the same
> function. Look at the way that you return the get_absolute_url:
>
> def
Thanks. It was something in your models.
Django can't just magically figure out what url you want besed on the same
function. Look at the way that you return the get_absolute_url:
def get_absolute_url(self):
return ('django.views.generic.list_detail.object_detail', (), { 'slug':
self.slug, })
Here's the elections model:
class Election(models.Model):
uuid = UUIDField(primary_key=True, editable=False)
election_name = models.CharField(max_length=100, unique=True)
slug = models.SlugField(prepopulate_from=("election_name",),
unique=True)
election_date = models.DateField()
You interested in answering the first part of my post? I can't really help
you with information like this...
2008/4/21 jeffself <[EMAIL PROTECTED]>:
>
> I don't think thats it because if I reverse the order of the url's in
> the root urls.py file and put precincts before elections, then
> precinc
I don't think thats it because if I reverse the order of the url's in
the root urls.py file and put precincts before elections, then
precincts items work correctly but the election items point to
precincts rather than elections.
On Apr 21, 3:52 pm, Michael <[EMAIL PROTECTED]> wrote:
> How are you
How are you getting the URL? Is there something in your models that is
defining the absolute URL? or are you using the Revese lookup?
Chances are because they are just copies of one another that you forgot to
change one of the files and they still have the get_absolute_url referring
to the electio
Show me -- Settings.py
2008/4/21, jeffself <[EMAIL PROTECTED]>:
>
>
> I've got a project that contains two apps (elections and precincts).
> My root urls.py looks like this:
> from django.conf.urls.defaults import *
> urlpatterns = patterns('',
> (r'^elections/', include('elections.urls')
I've got a project that contains two apps (elections and precincts).
My root urls.py looks like this:
from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^elections/', include('elections.urls')),
(r'^precincts/', include('precincts.urls')),
(r'^admin/', include('djang
9 matches
Mail list logo