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
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
&
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
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:
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
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
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
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):
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
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
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
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
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)
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
> 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.
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
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
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
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
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
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
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'
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
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
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.
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
>
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"
27 matches
Mail list logo