Sunday, January 27, 2013

Re: Form with variable fields

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAlEFlmwACgkQuYLL1cDjHx0O6QCfRpAUwHX5BQBh+DnFiAREzllh
MpMAnRG9WJZ1d386q6iINS3g2THWhTig
=9LCa
-----END PGP SIGNATURE-----
On Sat, 26 Jan 2013 17:38:03 -0800 (PST) sephii
<sylvaintersideral@gmail.com> wrote:
> Thanks for your answer. I wanted to avoid using a ManyToMany field in
> my case for two reasons:
> 1. The artist table has about 700'000 entries, which is really too
> big to fit in a <select> element
> 2. I could create an autocomplete text widget to overcome point 1),
> but the user should also be able to set a new artist that doesn't
> exist yet in the database using these fields
>
> Feel free to let me know if you think of a solution that would
> overcome these 2 issues.

1) Tell django to use a text-input or your own widget to display the
artist-field.
2) Write your own widget to enter text, search via ajax and then set
the artist.

At least thats what we do with m2m-fields with ~20.000 entries.

Have fun,

Arnold

No comments:

Post a Comment