On 15 jan, 17:11, elspiko <[email protected]> wrote:
> Hi guys,
>
> I'm just wondering if what I want to achieve is possible. What I'm
> doing is creating a file replication application with a django front
> end, and what I'm having trouble with is posting back the files to the
> webpage when the backup of each file is complete.
>
> What I want to be able to do is display the file name to the webpage,
> as they are being backed up. e.g. pseudo code
>
> for file in file_list:
>  backup_file(file)
>  print file
>
> Now I know i can return the entire list once the files have completed,
> but what I'm after is something similar to below:
>
> /path/to/file1.txt - complete
> /path/to/another/file.psd - complete
> ...
> ...
> ...
> Backing up: /path/to/foo/bar.jpg
>
> If this isn't possible then I'll have to live without this, but I'd
> like to be able to do it if it is.

Two possible solutions:

1/ pass your httpResponse object an iterator that will wrap the
effective code and yields appropriate markup for each file. Note that
this means the page won't be fully loaded until all backups are done.

2/ use Ajax to update your page.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to