0

I am attempting to use this snippet: http://www.djangosnippets.org/snippets/1095/ on a model I am building- I am defining things as:

first = models.TextField()
last = models.TextField()
email = models.EmailField(default=None)
screen = models.TextField()
password = models.EncryptedCharField()
icon = models.ImageField(upload_to='avatars/')

When I attempt to validate the model (running syncdb) it gives me an error that states that the "EncryptedCharField" is not defined.

I have the code from that snippet present in my model.py file- is this incorrect? do i need to implement this snippet elsewhere, or have it extend a different class?

Thock
  • 177
  • 1
  • 9
  • I am attempting to follow the docs listed here: http://docs.djangoproject.com/en/1.1/howto/custom-model-fields/ but where do these files go? the django docs don't say much about where these should live in the filesystem. – Thock Mar 08 '10 at 21:13

1 Answers1

0

It's saying that EncryptedCharField is not defined in models. If it's defined in the current module then you should not be trying to reference it from a different module.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
  • But the model i'm defining and the declarations for the encrypted strings are in the same model.py file- the same 'place'. Where -should- this logic go? – Thock Mar 08 '10 at 21:17