Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#1985 closed defect (fixed)

CurrentSiteManager can't find field

Reported by: kwevans@… Owned by: adrian
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: UI/UX:

Description (last modified by adrian)

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 Changed 9 years ago by adrian

  • Description modified (diff)

Fixed formatting in description.

comment:2 Changed 9 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

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

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