Re: Django - Pass a model instance specified by template tags to the view

2017-11-09 Thread Adam Simon
I would recommend taking a look at how Jquey does Ajax. It’s a lot simpler than Django forms. I will post some example code when I get home On Thu, Nov 9, 2017 at 3:42 PM Jack Zhang wrote: > No I am not familiar with Ajax. I only know a bit of JavaScript. > ᐧ > > On Thu, Nov 9, 2017 at 6:19 PM

Re: Django - Pass a model instance specified by template tags to the view

2017-11-09 Thread Jack Zhang
No I am not familiar with Ajax. I only know a bit of JavaScript. ᐧ On Thu, Nov 9, 2017 at 6:19 PM, Adam Simon wrote: > > Hi Jack. I will write some more details when I get home. Have you ever > used Ajax? > > On Thu, Nov 9, 2017 at 3:14 PM Jack wrote: > >> Ok I'm very stuck. Thought very hard

Re: Django - Pass a model instance specified by template tags to the view

2017-11-09 Thread Adam Simon
Hi Jack. I will write some more details when I get home. Have you ever used Ajax? On Thu, Nov 9, 2017 at 3:14 PM Jack wrote: > Ok I'm very stuck. Thought very hard about it but can't see how I can add > a hidden field into the HTML, and relay the specified instance of the > hidden field back to

Re: Django - Pass a model instance specified by template tags to the view

2017-11-09 Thread Jack
Ok I'm very stuck. Thought very hard about it but can't see how I can add a hidden field into the HTML, and relay the specified instance of the hidden field back to the views... or am I completely off about something? Also in regards to the looped form's. If you look at my original code, I ac

Re: How do I pass the CSRF token when using a jQuery post

2017-11-09 Thread Tony King
Thanks Gourav, I have it working now and I can even understand it, which is even better. For anyone interested my revised working solution is below. I'm sure it would be better practice putting the token into the headers as described in the documentation and elsewhere but I could not get it t

Re: Django - Pass a model instance specified by template tags to the view

2017-11-09 Thread Adam Simon
Each form would be generated by a loop; still I would go with the hidden field. Look forward to seeing how it goes. On Thu, Nov 9, 2017 at 6:46 AM Jack wrote: > There will be a lot of agents in the database, so would it violate the DRY > principle if I were to write a form for each agent? Plu

Re: Django - Pass a model instance specified by template tags to the view

2017-11-09 Thread Jack
There will be a lot of agents in the database, so would it violate the DRY principle if I were to write a form for each agent? Plus it'll be super time consuming. I'm going to try the hidden agent.id thing, I never thought about that. I'll report back to see if I managed to get it working.

Re: executing python script in html button

2017-11-09 Thread Vineet Kothari
Use bokeh On Nov 9, 2017 1:44 PM, "Derek" wrote: > Hi > > Its unlikely anyone on this list will write your code - but the good news > is that are lots of helpful tutorials from which you can learn to do this; > for example: > > * https://docs.djangoproject.com/en/1.11/intro/tutorial04/ > * https

Re: executing python script in html button

2017-11-09 Thread Derek
Hi Its unlikely anyone on this list will write your code - but the good news is that are lots of helpful tutorials from which you can learn to do this; for example: * https://docs.djangoproject.com/en/1.11/intro/tutorial04/ * https://tutorial.djangogirls.org/en/django_forms/ * https://www.simpl