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
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
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
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
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
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
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
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
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.
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
10 matches
Mail list logo