Hello. I'm working on the custom admin page that will serve batch
items creation based on the uploaded file.
All these items should be linked to the single foreign key item.
This item should be selected on the form.
Of course, I can investigate the inner structure of the rendered admin
pages and
To get the plus icon back, you need to wrap the field in a
RelatedFieldWidgetWrapper. Here's an example from my code--obviously,
you'll have to adapt it to fit your situation.
class CategoryChoiceField(forms.ModelChoiceField):
def __init__(self, *args, **kwargs):
super(CategoryChoic
Well, looks that the ModelChoiceField solves the problem except of the
plus icon
On Dec 9, 12:34 pm, Eugene Mirotin <[EMAIL PROTECTED]> wrote:
> Hello. I'm working on the custom admin page that will serve batch
> items creation based on the uploaded file.
> All these items should be linked to th
I was busy for several days and could give it a try only now. Thank
you for the answer, but I still can't make it work.
I have the model called Tournament and the model called
TournamentResult which has foreign keys Team and Tournament.
What I'm doing is a page for bulk upload of the results for
You're passing your queryset in, but you're never using it in your
widget. In my code, see how I have:
widgets.CategorySelect(
categories=models.Category.objects.order_by('parent',
'list_order')
),
I don't have the code on hand for my CategorySelect widget, but I
remember that it takes "cat
Thank you very much for the help. It have finally solved the problem.
BTW, one issue was left - the plus icon redirected to the creation
page instead of opening popup.
I've solved it by including the
directly in my template, but it's strange since my template extends
the "admin/change_form.html"
Glad to help.
That's strange that you had to add that JS to your template--it should
be included automatically. Looking at the admin default options:
http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/options.py#L202
it should be on every object add/edit page.
Maybe you def
I have only overriden the title and content blocks, nothing more, so
it really looks strange
On Dec 13, 10:04 pm, Jeff FW wrote:
> Glad to help.
>
> That's strange that you had to add that JS to your template--it should
> be included automatically. Looking at the admin default
> options:http:/
8 matches
Mail list logo