Jannis Liedel writes about a great widget for FK fields
http://jannisleidel.com/2008/11/autocomplete-form-widget-foreignkey-model-fields/
I manged to get it to work on one site, but not on others.
Widget uses admin search functionality through url:
/admin/app/model/search/?
Article model has MM field to Authors. Editing an Article 123 would
than be:
>>> f = ArticleForm( instance=Article.objects.get(id=123) )
But than:
>>> f.is_valid()
False
>>> f.data
{}
>>> f._errors
{}
>>> f.is_bound
False
Closer look at the form object "author" field:
>>>
t wasn't an option for
> me but it might help
> you.http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-op...
>
> On Apr 16, 3:40 am, maco <marko.dvor...@gmail.com> wrote:
>
> > My model has two Foreign Keys. Each FK has 4000 entries or more. In
> > ad
My model has two Foreign Keys. Each FK has 4000 entries or more. In
admin.py I use filter_horizontal for those FK.
I noticed that JS widget is slow both on first render of admin page
(add item) and on every selection of an FK item inside the widget. I
takes 5 seconds AFTER admin page already
Can you share the logic behind the models and views you use. Don't
need to go into details, just the philosophy behind it, eg.
http://orestis.gr/en/blog/2007/05/14/international-part3/
cheers
On Jan 26, 5:36 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote:
> Piotr, having django-multilingual
-text-search/
On 24 dec., 09:46, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Sun, 2007-12-23 at 05:37 -0800, maco wrote:
> > Yes, I've seen that, thanks anyway.
>
> > I've been googling for the past few days on this topic and I'm amazed
> > that there i
Try this one:
http://www.djangoproject.com/documentation/db-api/#get-foo-filename
To retrieve a image or file absolute url simply use:
{{ object.get_myImageObject_url }}
Absolute URL is compiled according to settings.py definition of
MEDIA_URL and therefore changes automatically at deployment.
7 matches
Mail list logo