Re: Inline element not working as expected.

2011-10-25 Thread jenia ivlev
This is how you do it: class ItemInline(admin.TabularInline): model = Category.items.through class CategoryAdmin(admin.ModelAdmin): inlines = [ ItemInline, ] exclude = ('items',) On Oct 24, 9:48 pm, jenia ivlev wrote: > In the admin I want to use inline ele

Inline element not working as expected.

2011-10-24 Thread jenia ivlev
In the admin I want to use inline elements. I want category to display the items it is related to. But I get this error: Exception at /admin/store/category/7/ has no ForeignKey to It's true, of-course, since I chose to use Category to point to the items it has. But, how can I get the admin to l

Cannot install freetype to use the 'django-simple-captcha' application.

2011-10-22 Thread jenia ivlev
Hello. I want to install Freetype and pil for windows and don't know how to proceed. I'm using python 2.7 with Django and windows 7. I installed the PIL and Freetype binaries but still my code cannot execute Freetype (although PIL works perfectly). That's the Freetype libaries: http://gnuwin3

Re: problem with middle - correctly formatted 2

2011-09-28 Thread jenia ivlev
You need to call "TemplateResponse" in your views for "process_template_response" to be called in your middleware. So in you view, instead of doing: return render(request,'some template' , {'context':context}) You do: return TemplateResponse. Thanks. jenia

problem with middle - correctly formatted 2

2011-09-28 Thread jenia ivlev
Hello: I have defined a middleware class. and i have added it to the middleware_classes attribute in setting. When a request comes in, the middleware class gets created (the debugger catches the code when the breakpoint is on the class CommonFiilter(): line) Now i expect the function def process

problem with middleware - correctly formatted

2011-09-28 Thread jenia ivlev
Hello: This is the second version of my question. I reformatted it. I have defined a middleware class. and i have added it to the middleware_classes attribute in setting. When a request comes in, the middleware class gets created (the debugger catches the code when the breakpoint is on the class

problem with middleware

2011-09-28 Thread jenia ivlev
Hello: I have defined a middleware class. and i have added it to the middleware_classes attribute in setting. When a request comes in, the middleware class gets created (the debugger catches the code when the breakpoint is on the class CommonFiilter(): line) Now i expect the function def process

Re: Problem on user profile

2011-09-28 Thread jenia ivlev
Thanks but it wasnt this. I was tired and didnt see some gross mistakes. Thanks for your help though On Sep 28, 6:01 am, Thomas Orozco wrote: > You might be importing your models.py file multiple time, thus registering > the signals multiple times. > > You should look into the signals documentati

user authentication problem

2011-09-27 Thread jenia ivlev
Hello. I want to register users. So I made a RegisterForm(ModelForm): Class Meta: model=User (from django.auten.contrib.User) no i display that form in a view and submit it. When i do form.is_valid(), i get this validation error: Your username and password didn't match. Please try again.

Model Validation

2011-09-24 Thread jenia ivlev
I have a model M that has a field num=models.IntegerField() I have a modelform called 'F' for model 'M'. I want to ensure that num is never negative. If I do validation in my form class, 'F', then i can do clean_num(): if negative than throw ValidationError('Num can never be negative'). This valid