localStorage to save answer to form until it is sent to server

101 views
Skip to first unread message

Raniere Silva

unread,
Nov 10, 2016, 11:06:18 AM11/10/16
to Django users
Hi all,

I have some text area on my form that I expected that the user will take
a few minutes to answer and I want to avoid them to need to type
everything again if something happen (e.g. their device got out of
battery). Something that I think I could use is localStorage to store
the temporary answer. I couldn't find a native solution to my problem
neither a package. Did I missed something? Or I'm on the wrong path?

Cheers,
Raniere

ludovic coues

unread,
Nov 10, 2016, 2:26:46 PM11/10/16
to django...@googlegroups.com
localStorage is a client-side technology. You interact with that using
javascript.
Django only deal with the server-side.

If the text area you are talking about is in the django's admin, you
should take a look at how third party providing rich editing textarea
are doing.
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2f5c60ff-76bd-4706-bc04-2a0adf1c4a76%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--

Cordialement, Coues Ludovic
+336 148 743 42

Mike Dewhirst

unread,
Nov 10, 2016, 7:39:46 PM11/10/16
to django...@googlegroups.com
I have a copy of Mark Pilgrim's HTML5 Up and Running. Chapter 7 probably
covers everything you want. Here are chapter 7 section headings copied
from the O'Reilly site. Google "html5 up and running" and that site
appears at the top of the list.

1.


Diving In

2.


A Brief History of Local Storage Hacks Before HTML5

3.


Introducing HTML5 Storage

4.


Using HTML5 Storage

5.


HTML5 Storage in Action

6.


Beyond Named Key/Value Pairs: Competing Visions

7.


Further Reading





>
> Cheers,
> Raniere
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> <https://groups.google.com/d/msgid/django-users/2f5c60ff-76bd-4706-bc04-2a0adf1c4a76%40googlegroups.com?utm_medium=email&utm_source=footer>.

Fred Stluka

unread,
Jan 2, 2017, 8:03:54 PM1/2/17
to django...@googlegroups.com
Raniere,

Another possibility is to do the temporary storage on the server
instead of the client.  Use JavaScript to make an occasional Ajax
call to the server to store the current data in the session.  Don't
necessarily have to store it in the DB.  Make the occasional calls
based on a JavaScript timer or something.  Many web-based tools
use this technique.  For example, Google Docs.

--Fred

Fred Stluka -- mailto:fr...@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.

Reply all
Reply to author
Forward
0 new messages