Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#1985 closed defect (fixed)

CurrentSiteManager can't find field

Reported by: kwevans@… Owned by: Adrian Holovaty
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Adrian Holovaty)

The code (taken from docs) in rev [2970] ..

from django.db import models
from django.contrib.sites.models import Site
from django.contrib.sites.managers import CurrentSiteManager

class Photo(models.Model):
    photo = models.FileField(upload_to='/home/photos')
    photographer_name = models.CharField(maxlength=100)
    pub_date = models.DateField()
    publish_on = models.ForeignKey(Site)
    objects = models.Manager()
    on_site = CurrentSiteManager('publish_on')

Does not work, gives following error. Changing publish_on to site also does the same. Environment OSX and mysql, svn version [2970]

raise ValueError, "%s couldn't find a field named %s in %s." % \
ValueError: CurrentSiteManager couldn't find a field named publish_on in Photo

Change History (2)

comment:1 by Adrian Holovaty, 18 years ago

Description: modified (diff)

Fixed formatting in description.

comment:2 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

(In [2989]) Fixed #1985 -- Got CurrentSiteManager working

Note: See TracTickets for help on using tickets.
Back to Top