i am working with openlayers, extjs , django
is there any way taking another site post and do sth. with django or extjs...
for exam. from another site you click button it sends xy coordinate and my main site will catch the data and add the xy data ...
when i click the link http://www.ppp.com/frmOL=OL&Point&x=36.555&y=33.665 will be create , i will cath the data ,encode and than add the data to map
thanks for your help
Just get the data from the query string, process it and add it to your database.
Related
I am working on a project which sends data to django server using POST request (not through web browser) and updates data on models.
My templates just runs through all the data in models and print it in a table.
The problem here is that I've to manually refresh my page to get the updated data.
I want my page to auto-update the data entered into models.
I'm very new to django, so is there a way to achieve this?
(I'll post the codes if needed)
I followed the DJango-tables2 official tutorial and was able to create data set in the terminal using:
Person.objects.bulk_create([Person(name='Jieter'), Person(name='Bradley')])
However, the new data in the table on the website doesn't show up until I hit the refresh button. My question is how the table can be updated/refreshed without any human interaction on the webpage.
What I'm trying to achieve is to update the table on the webpage without human interaction as soon as new data comes in. I'm relatively new to this, any suggestions would be greatly appreciated.
Thank you.
To avoid refreshing the page you would need to get new data using an Ajax request, this table use template rendering meaning it is not meant to work like you want to use it.
Usually, to do what you want to do, you need a front end JavaScript component like Datatables.net, FancyGrid ... and make requests to server using Ajax to get new data.
I have a set of images and I'd like to display them to a user and collect the location of mouse clicks on each image. I'd like to do this using django because ultimately I want to integrate these click event data with an existing database that's managed with django.
I know I could do this by coding up my own Python application that displays the image, collects mouse clicks, and stores them in the database. But is there an existing django extension or form that already does this? I'm having trouble getting any useful hits on google.
From what i understand you are collecting data from a front-end level. For something like this you should collect the data with Javascript running on your page and have it send an AJAX post to you Django API. That would allow you to store the data easily.
As Django forms operate off of HTTP requests I do not think that there is an extension for doing this in the current Django ecosystem.
use case:
user click on comment column to leave a comment.
comment is sent via post to the server.
server uploads to the database.
however instead of merely updating the page, Django puts my whole page into the into the table cell
before:
http://i50.tinypic.com/28cdkb7.jpg
after:
http://i45.tinypic.com/346vuag.jpg
http://formerlyconversal.wordpress.com/2009/11/01/inline-editing-with-jquery-jeditable-and-django/
you are probably looking for this.
I am doing a project in Django and i want to have some google maps displayed in my site. So, i installed django-easy-maps and successfully used it in a sample template. So, i am ready with my maps.
The interface i want to implement is this
http://i49.tinypic.com/sowm74.png
I want to display the maps where the Hellow World! container is and with different links on the sidebar i want to refresh the map being displayed on user click without reloading the page.
I did some researching and it seems Ajax is the solution...
Can anybody tell me how i might achieve this (with or without Ajax ) ?
Sorry for sounding like a noob but i am fairly new to this.
The basic steps are:
Create a view for the Google Maps section to the right. This view does not return a full HTML page but only the HTML for that section (which contains your Google Maps map).
When the user clicks on a link on the left, use JavaScript to perform an ajax call to request that page. In short this means: attach an event handler to the onclick event of those links and in code you can perform an ajax call .Many people use a JavaScript library for this purpose, such as jQuery (which has $.ajax()).
You can then use JavaScript to put the received HTML inside the container on the right (using $.html()).