Re: Custom admin field widgets in the newforms-admin branch

2007-06-27 Thread leif strickland
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

Re: Announcing the birth of Fluther.com

2007-06-27 Thread leif strickland
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

Re: Zip code lookup field

2007-06-27 Thread leif strickland
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

Re: Zip code lookup field

2007-06-27 Thread leif strickland
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

Re: Zip code lookup field

2007-06-27 Thread leif strickland
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

Re: Zip code lookup field

2007-06-27 Thread leif strickland
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:

Re: Zip code lookup field

2007-06-27 Thread leif strickland
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: ---

Re: Zip code lookup field

2007-06-27 Thread leif strickland
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

Re: Zip code lookup field

2007-06-27 Thread leif strickland
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