Re: Passing values

2019-02-13 Thread Ivan Martić
e.now is allways available in any python file you are > working on it, and also request and request.user > > What do you want to do exactly? > > On Wednesday, February 13, 2019 at 1:45:46 PM UTC+3:30, Ivan Martić wrote: >> >> Hi all, >> >> where can i find mor

Re: Passing values

2019-02-13 Thread Mohammad Etemaddar
t.user What do you want to do exactly? On Wednesday, February 13, 2019 at 1:45:46 PM UTC+3:30, Ivan Martić wrote: > > Hi all, > > where can i find more info regarding passing values in views/forms/url. > What I need is to pass value from form in previous url page to the form in &

Passing values

2019-02-13 Thread Ivan Martić
Hi all, where can i find more info regarding passing values in views/forms/url. What I need is to pass value from form in previous url page to the form in next url page(also prefilling with data like timezone.now, request,user) Thank you in advance. Ivan -- You received this message because

Re: Passing values from Python to Javascript

2018-05-24 Thread Cuneyt Mertayak
It is going to be like following. In HTML (doesn't have to be div of course any HTML tag can get data attribute: ... Then in JS: var dataElement = document.getElementById('backend-to-js-name'); var name = dataElement.dataset.name; console.log(name); Check it out "data" attributes here: https:

Re: Passing values from Python to Javascript

2018-05-24 Thread Akshay Gaur
Hi Cuneyt, How do you add the data fields and their values to tags generated by python? For example, how would you add a data field to something generated by {{ form.name }}? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: Passing values from Python to Javascript

2018-05-24 Thread Akshay Gaur
Hi Cutest, How do you add the data fields and their values to tags generated by python? For example, how would you add a data field to something generated by {{ form.name }}? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: Passing values from Python to Javascript

2018-05-23 Thread Cuneyt Mertayak
As you can guess this is general problem for all backend languages for passing data to JS. AFAIK the standard practice is attaching the value to a DOM element as "data" property and using fetching the value from that element in your JS. If it is a primitive value it is easy to do so, if it is

Re: Passing values from Python to Javascript

2018-05-23 Thread Akshay Gaur
Hi Steve, I am new to Django as well. To do what you wanted to do (pass values from python to js), I used ajax queries (using jquery) and then did a JsonResponse to the ajax call. The ajax call then handles the data as required. Sample usage: VIEWS.PY: class InstructorDeleteView(DeleteView):

Passing values from Python to Javascript

2018-05-23 Thread steve Valet
I am trying to pass values from Django/Python to Javascript, and have it working to a degree, but need some assistance (obligatory: I'm new to Django so could be hosing this) I have three files in play here, *views.py, app.js, home.html*. I can get the values passed to home.html as part of the

Re: Is passing values into the admin add page possible?

2010-05-11 Thread nih
ah nice one Jason :) sorry it took me a while to respond, I had a load more problems and I sort of forgot about this one I didn't get your solution working, but while I was hacking away and searching the net for ideas I found request.GET.get('q', '') in http://stackoverflow.com/questions/15050

Re: Is passing values into the admin add page possible?

2010-05-09 Thread leveille
On May 9, 4:58 am, nih wrote: > I've got a python program that starts up a django web app, I'm trying > to figure out how to pass values from the program to the web app so > some fields in the admin add page are automatically populated with > values from the program, is the only way via url parame

Is passing values into the admin add page possible?

2010-05-09 Thread nih
Hi all I've got a python program that starts up a django web app, I'm trying to figure out how to pass values from the program to the web app so some fields in the admin add page are automatically populated with values from the program, is the only way via url parameters?, I sense its a lot more c

Re: Passing values to template

2008-11-18 Thread David Zhou
On Tue, Nov 18, 2008 at 1:54 PM, Ross Dakin <[EMAIL PROTECTED]> wrote: > >> Others already gave you practical answers, so this will be mostly a >> more general ('conceptual' ?) advice: don't mix heterogenous data >> (objects, whatever) in a list. If you have a compelling reason (ie : >> ordering)

Re: Passing values to template

2008-11-18 Thread bruno desthuilliers
On 18 nov, 19:54, Ross Dakin <[EMAIL PROTECTED]> wrote: > > Others already gave you practical answers, so this will be mostly a > > more general ('conceptual' ?) advice: don't mix heterogenous data > > (objects, whatever) in a list. If you have a compelling reason (ie : > > ordering) to have het

Re: Passing values to template

2008-11-18 Thread Ross Dakin
> Others already gave you practical answers, so this will be mostly a > more general ('conceptual' ?) advice: don't mix heterogenous data > (objects, whatever) in a list. If you have a compelling reason (ie : > ordering) to have heterogenous data, wrap them all in a same 'meta' > data structure.

Re: Passing values to template

2008-11-17 Thread bruno desthuilliers
On 17 nov, 16:45, Alex Jonsson <[EMAIL PROTECTED]> wrote: > Hey guys, > > I have a news application that I would like some help with. > > My view generates a list with objects mixed with dictionaries with two > objects. (snip) > Or is there a better way of doing this other > than mixing objects

Re: Passing values to template

2008-11-17 Thread Alex Jonsson
Thanks to both of you! David's suggestion fits my application perfectly. Again, big thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@goog

Re: Passing values to template

2008-11-17 Thread Rajesh Dhawan
Hi Alex, > I have a news application that I would like some help with. > > My view generates a list with objects mixed with dictionaries with two > objects. Then in my template, I want to loop through this list and > output each value. However, when it encounters a dictionary in the > list I want

Re: Passing values to template

2008-11-17 Thread David Zhou
On Mon, Nov 17, 2008 at 10:45 AM, Alex Jonsson <[EMAIL PROTECTED]> wrote: > So the question is: how do I check (in the template) if the object > that is being run in the for loop is a dictionary, so that I in turn > can run a for loop on it? Or is there a better way of doing this other > than mix

Passing values to template

2008-11-17 Thread Alex Jonsson
Hey guys, I have a news application that I would like some help with. My view generates a list with objects mixed with dictionaries with two objects. Then in my template, I want to loop through this list and output each value. However, when it encounters a dictionary in the list I want it to loo

Re: Passing values from Django to client-side JavaScript

2007-01-21 Thread rzimerman
Jeremy Dunck wrote: > On 1/19/07, rzimerman <[EMAIL PROTECTED]> wrote: > > > > I'd like to pass variable values from Django to client-side JavaScript > > at page load time. Currently I've use Django's templating system to > > dynamically rewrite the JavaScript code, such that the appropriate > > v

Re: Passing values from Django to client-side JavaScript

2007-01-19 Thread Brian Beck
The JSON method mentioned above should work fine. Two methods that might be less fragile than code generation: - Hidden form inputs. Less fragile because the 'escape' filter should allow you to safely dump data into attribute values in your template, I think. Then use form.elements or MochiKit'

Re: Passing values from Django to client-side JavaScript

2007-01-19 Thread Jeremy Dunck
On 1/19/07, rzimerman <[EMAIL PROTECTED]> wrote: I'd like to pass variable values from Django to client-side JavaScript at page load time. Currently I've use Django's templating system to dynamically rewrite the JavaScript code, such that the appropriate values get set. But, is there a less hac

Re: Passing values from Django to client-side JavaScript

2007-01-19 Thread Jeremy Dunck
On 1/19/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: var foo = {{ data }}; alert(data['bouzouki']); Err, that should be: alert(foo['bouzouki']) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

Passing values from Django to client-side JavaScript

2007-01-19 Thread rzimerman
I'd like to pass variable values from Django to client-side JavaScript at page load time. Currently I've use Django's templating system to dynamically rewrite the JavaScript code, such that the appropriate values get set. But, is there a less hackish way? If it helps, I'm already using MochKit.

Re: passing values into form templates

2006-05-15 Thread Bill de hÓra
Bill de hÓra wrote: > So after catching the source URL off the POST request, and before > forwarding to the template, I seem to have two choices: > > - write the link into the FormWrapper/AddManipulator configuration's > data. > > - pass the link along as another param to the template >

passing values into form templates

2006-05-15 Thread Bill de hÓra
Hi, I have this forms contortion where a default value in the form varies based on the initial use choice, and I'm looking to see what's the sanest way to support it in django. It goes like this: User on any page can from a selection state a type of feedback ("this page", "this site", "other"