How to show search results no same - django-templates

I am new to Django, and want to do the following
I have a form that takes two inputs, processes and forwards the results to another page.
I want to display the results in the same page with form page included.
How can I do that in Django?
Thank you

Save the data in the session after the POST, and pull it out of the session on the other page.

Related

Separating redirection logic in angular pages

In my application we have a summary page having a link to take the user to the different pages of the application. For example, we have separate pages for collecting personal details, address details, education details etc., and there is a summary page giving the summary of a student's data. Users of the application will go to the summary page and then navigate to any individual pages in case if the data is not filled up yet. After the user goes to the individual page, they can enter the required details, and upon saving the entered details, they will be eventually redirected back to the summary page.
I have implemented the above functionality as below at the moment,
When the user clicks on a link to the address details page from the summary page, I will pass the redirect url as a query string to the summary page, and upon the user saves the address details in the address page, I will redirect the user back to the summary page using the redirect url passed on the query string.
Each individual pages have a common base class
Redirection logic is present in each individual pages now. This logic checks if there was a redirection url present in the query string, then if present it will direct the user to the summary page after the user clicks on the save button on the current page.
I feel the above solution is elementary, there is potential for adding new pages to our application.
I wonder if there is anyway to implement the above requirement in a elegant way in such a way that the redirection logic is separated as a angular service, route or any other angular technique so that we dont have to do any thing extra for the new pages that will be added in the future.

Why does the "I've got what I need" button sometimes not work in import.io?

I am using import.io and trying to create a crawler based on this page:
http://www.flashscore.com/match/IeHoEHvJ/#match-statistics;0
After selecting single rows (one row per page), and adding some columns and training them, I want to click on the button "I've got what I need!" in order to proceed and train another similar page. But it is not possible to click on the button, it is as if the program is waiting for me to train more even though it is not necessary (I have successfully completed this procedure on other website, but for some reason this page does not work).
Any idea why this does not work?
Please see the following screenshot of import.io when I am trying to click the button without success:
http://puu.sh/j5Vlm/fcc322549a.png
UPDATE: Got a reply from the import.io facebook group. Building a Crawler might not work due to robots.txt. But building an Extractor seems to work, only have to find an easy way to collect all the links to use in the extractor.
the website you're trying to scrape is probably protected by a robots.txt file so as the Facebook group told you I suggest you to try with Extractor.
The solution is a bit tricky but it should work.
Create an Extractor to grab the data you need from the page you want data from. I did it and it worked.
Create an Extractor to get the links: (Mine is here: 5ef25069-f0cc-4ac7-9184-b2a035277403) for this page
Then download the dataset as CSV, open it with a spreadsheet processor and add this string of text at the end of the link: #match-statistics;0
Finally copy the list of links and go back to import.io. Choose the feature Bulk Extract on the first API and paste the list of URLs.
It should work ;)

Yii CListView pagination linking to previous result

I have a CListView with pagination showing all results. Everything works fine.
I have a search widget on the page that renders a partial view to replace the existing list with search results.
The first search result page loads, looks great, and even shows the correct number of results in pagination, but if I try to go to one of the next pages, items from the first list are loaded.
Does anyone know what I have to do in order to fix this? Do the search results need their own full view rendered?
Thanks you in advance.
I was mistaken.
The pagination was not linking to the previous result, it was loading everything which the previous result also does, which is why I was mistaken.
I thought that the data provider in the controller kept track of the result set but you have to keep resending the same criteria every time. I was sending the criteria the first time and not on subsequent results so it loaded everything in absence of any constraints. I simply put the search parameters in session and then retrieved them so they could be considered on every request and it fixed the problem.
In short there is no bug, just me being new working with Yii.

Using ajax for rails image preview in form

I've been working on this issue for about two days now. I've posted more task specific questions, got great answers, only to figure out the approach I was taking wouldn't work.
Basically, I want a user to be able to upload images in a form and see a preview of the image they upload before submitting the form. The images and the parent form have a has_many relationship. The images are nested in the parent form using fields_for.
I tried using a client side approach, but ran into cross browser and security issues. My current approach I'm trying is to save the images, reload the div portion of the page, and then assign the parent_id to the image after the partent form is submitted (since I will not have a id for the partent form until it is created).
Is it possible to use ajax to submit the fields_for portion of a form and not the entire parent form? Has anyone attempted to do something similar?
Of course you can submit only the fields of that image by using jQuery to select only the fields that you want to send, serialize them and send them as data of the ajax request.
Be careful, you need to send the authtoken, that's why I have type=hidden in the selector
var data = form.find('[name*=image],[type=hidden]').not('[name*=items]').serialize();
$.ajax({url: this.form.attr('action'), context: this, type: 'POST', data: data
The next step with the image I once implemented as storing the in their own database table, returning the client the id to that who then adds it to the form.

Automatic Webpage Data Entry based on The Page Content

Is it possible to make a program that open a page (as if a bookmark file were opened by IE), and based on its content generate a feedback, that should be fedback in a textbox on said page by pressing a button on said page?
I need this program to execute on a set time schedule to feed some data to a web server based on time dependent web page data.
Yes, that is possible. It is generally called screen scraping. You basically retrieve the web page in question via a HTTP request, parse/analyze the page you got, then send back the data that should go into the textbox (again a HTTP request).
There are libraries to do that. Here is an article describing an example in Perl:
http://www.perl.com/pub/a/2003/01/22/mechanize.html