OK, I've been tinkering with this all day, and I'm still having one
big problem
As Jeremy suggested, I created custom ZipCodeField and MyAdmin
classes. In addition, I created a custom ZipcodeLookupInput widget.
I've tested this in the shell and on the test server, and the clean
and render functi
OK, I've been tinkering with this all day, and I'm still having one
big problem
As Jeremy suggested, I created custom ZipCodeField and MyAdmin
classes. In addition, I created a custom ZipcodeLookupInput widget.
I've tested this in the shell and on the test server, and the clean
and render functio
Yes, the ModelAdmin is registered with django.contrib.admin.site. And
the change and add pages for the model are displaying correctly. It
even provides the expected error message if I enter an invalid Zip
code.
But when I enter a correct Zip code and Save, it gives me an Integrity
Error:
---
Yes, the ModelAdmin is registered with django.contrib.admin.site. And
the change and add pages for the model are displaying correctly. It
even provides the expected error message if I enter an invalid Zip
code.
But when I enter a correct Zip code and Save, it gives me an
Integrity
Error:
Here's a bit of the testing I have run in the shell...
>>> from mysite2.profile.models import Profile
>>> from django import newformms
>>> from mysite2.admin import ProfileOptions
>>>
>>> # instantiate a Profile object
>>> test_profile = Profile.objects.get(id=1)
>>>
>>> # instantiate the admino
Here's a bit of the testing I have run in the shell...
>>> from mysite2.profile.models import Profile
>>> from django import newforms
>>> from mysite2.admin import ProfileOptions
>>> # instantiate a Profile object
>>> test_profile = Profile.objects.get(id=1)
>>> # instantiate the adminoptions cla
I figured it out!
The problem was that my custom zip code field's clean() function was
returning the profile object's *id*, not the actual zip code
instance.
> zip_code_id = Postal_Code.objects.get(postal_code=value).id
> return int(zip_code_id)
As it turns out, the function should have retur
Looks great. Good work!
For those of us still stuck in alpha, can you share a bit about your
implementation? Are you using Apache? Squid? What's your approach to
caching? Did you use Django's built-in User model for your registered
site users? What DB did you opt for?
Any information would be a
After some digging around, it looks like the newforms-admin branch
does not allow widget declarations within the model class itself.
However, adding a custom widget is quite easy.
In the branch, almost all of the admin app functionality has been
moved out of the inner Admin class and into a separ
9 matches
Mail list logo