i got a question: is it possible to set a field as multi-values, each value comes from foreign key to another table?
nozavroni
FunkyBob: sorry I see you answered my question a while back and it's not exactly what I'm looking for. let me explain my problem and maybe you can better help me
I have a form that allows the user to add their rental history. I want them to be able to add as many previous rentals as they like. To do this, I want to create a template that I can render on the page every time the user clicks "add rental"...
exaroth joined the channel
FunkyBob
nozavroni: sounds like you want a formset
nozavroni
yes
Evie_Hammond joined the channel
thats exactly what I want
but I'm having trouble executing it
I want it to show only one form but have a button they can click to add additional forms as they need them
but in order to do this, I either have to pull the form into the page via ajax, or render additional forms and just hide them until the user clicks the button
but neither is proving to be particularly easy
because once the user clicks "submit", if there is an error, I have to have code to show the additional forms on subsequent renderings
and no matter what I've tried the code just gets too ugly and complex for such a simple problem
dodobas
yelloo
Technodrome has quit
Sir_Narwhal has quit
FunkyBob
dodo
nozavroni: you don't need ajax to pull the blank form... just look at how admin does it
but you will need JS
the formset provides you an empty form instance to use as a template
exaroth has quit
nozavroni
the formset has rendered three empty forms on the page
your previous question didn't appear to have _anything_ to do with forms or formsets
nozavroni
lol I realize that I'm doing a poor job of asking my questions
softinio joined the channel
and you have been very helpful
bee_keeper
Anyone feel like helping me understand why sdist won't build a package that includes a template folder? Feel I've tried all the 'include_package_data=True' type permatations and manifest options but to no avail..
FunkyBob
aiui Admin renderes a hidden blank form to use as a template for adding new forms to the set on the fly
nozavroni
to look at how admin does it, do I just look in django.contrib.admin?
but as for that empty_form thing, it doesn't really provide much information about it. just that one paragraph. I can't figure out how to use it
ugh im lost
ewjoachim joined the channel
when I call empty_form() I get "'property' object is not callable"
ohrstrom joined the channel
tobiasthedev joined the channel
oh nevermind I got it to work... I think I can figure this out now
omnish has quit
omnish joined the channel
am I just supposed to replace __prefix__ with a number via javascript?
JayFK joined the channel
Tr0p1caL joined the channel
FunkyBob
as I said.. look at what admin's JS does for inlines
or wait until nlh logs on
Left_Turn joined the channel
audioburn has quit
fflair12 has quit
JayFK
is it possible to define a fallback language other than the default language? I have a site with a large german codebase and 100% EN translations. I'd like to fallback to EN if no translations are available for e.g. ES and not to DE.
nozavroni
I've been poking around in the admin without much luck but ill keep trying