[pyar] FieldDoesNotExist('%s has no field named %r' % (self.object_name, name))

Jonathan G Linenberg jlinenberg en gmail.com
Sab Abr 7 14:02:00 ART 2012


Gente como va?

Hace 2 días vengo googleando este problema y no encuentro solución. En los
modelos de django tengo esto:

*models.py*

from django.db import models
from django.utils.translation import ugettext_lazy as _

#===============================================================================
# Province model
#===============================================================================
class Province(models.Model):
    name = models.CharField(_('name'), max_length=30)

    class Meta:
        verbose_name = _('province')
        verbose_name_plural = _('provinces')

    def __unicode__(self):
        return u'%s' % (self.name)
#------------------------------------------------------------------------------

Y cuando hago un *python manage.py syncdb* obtengo:

Traceback (most recent call last):
  File
"C:\Users\Linenberg\Dropbox\WorkSpace\RescueCommittee\RescueCommittee\manage.py",
line 14, in <module>
    execute_manager(settings)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py",
line 438, in execute_manager
    utility.execute()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py",
line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python27\lib\site-packages\django\core\management\base.py", line
191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "C:\Python27\lib\site-packages\django\core\management\base.py", line
219, in execute
    self.validate()
  File "C:\Python27\lib\site-packages\django\core\management\base.py", line
249, in validate
    num_errors = get_validation_errors(s, app)
  File
"C:\Python27\lib\site-packages\django\core\management\validation.py", line
122, in get_validation_errors
    if not f.rel.to._meta.get_field(f.rel.field_name).unique:
  File "C:\Python27\lib\site-packages\django\db\models\options.py", line
289, in get_field
    raise FieldDoesNotExist('%s has no field named %r' % (self.object_name,
name))
django.db.models.fields.FieldDoesNotExist: Province has no field named
<django.utils.functional.__proxy__ object at 0x00000000039A6780>

Si alguno le paso y puede arrojarme algo de luz en este problema se lo voy
a agradecer!

Saludos!
--
*Jonathan G. Linenberg*
Linux User # 521828
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20120407/3638e16f/attachment.html>


More information about the pyar mailing list