Coder Social home page Coder Social logo

django-async-include's Introduction

django-async-include

License Maintenance made-with-python PyPI pyversions PyPI version gelidum PyPI status PyPI download month Maintainability Test Coverage

Asynchronous inclusion of Django templates

What's this?

This is a project to help the ajax load of chunks of HTML with minimal effort on the developer side, providing an easy way to improve web-site experience for your users by minimizing perceived loading times.

This is the development repository.

How does it work?

The async_include template tag sends the context to the server using an AJAX request.

In the case of model objects, it sends the model, application and id. In the case of QuerySets, it sends the encrypted parametrized SQL. Of course, in the case of safe values like strings, booleans or numbers this data are sent "as is".

The receiver is a basic view of this application that renders the template with the received context and returns it in the AJAX call.

Requirements

This application only depends on pycryptodome and jsonpickle.

Of course, you will need Django version 1.10 or newer.

jQuery

No jQuery is required as of version 0.6.6.

Fontawesome (optional)

Fontawesome is the the-facto standard of font icons of our time. Include it in your project to see the spinner moving when loading the remote templates.

The easiest way to include it by using a CDN. For example, bootstrap CDN (not affiliated, nor they endorse this project) is one of the most known.

Default waiting spinner uses fontawesome. You can overwrite async_include/spinner.html template if don't want to use the default fontawesome style.

Installation

Using pip

This package is in pypi so you only have to write:

pip install django-async-include

to install it.

Install master version

Include this code in your requirements.txt file:

-e git://github.com/diegojromerolopez/django-async-include.git#egg=django_async_include

Installation in your Django project

Include the application in your project's settings.py:

INSTALLED_APPS = [
    ## ...
    'async_include',
]

Include django-async-include URLs

Include the URLs of Django-Async-Include in your urls.py project in the namespace async_include:

from django.urls import path, include

urlpatterns = [
    # ...
    path(r'async_include/', include('async_include.urls', namespace="async_include")),
]

Use

Load the async_include template tags at the top of your file and use the async_include template tag as a replacement of the django include template tag.

You have to pass the local context explicitly to the async included templates, so you can pass all variables you need in your included template as named parameters of the async_include template tag.

{# Load the async_include template tag at the top of your template file #}
{% load async_include %}

{# Call the async_include template tag indicating what objects needs to replace it #}
{% async_include "<path of the >" <object1_name>=<object1> <object2_name>=<object2> ... <objectN_name>=<objectN>  %}

There is also a repository with a full example: django-async-include-example.

Call javascript function whe load is completed

Pass the attribute onload with the name of the function you want to call after the request and the replacement has been completed. e.g.

{% async_include "boards/components/view/current_percentage_of_completion.html" board=board onload="load_board_style" %}

Warning and limitations

Object dynamic attributes

No dynamic attribute will be passed to the templates given that only a reference to it is passed from the caller to the included template callee. Don't use dynamic attributes inside an async_included template.

However, the full object will be passed to the async_included template, so you could call its methods and properties without any problem.

QuerySets

Each QuerySet is passed as encrypted SQL and converted on the receiver to a RawQuerySet.

Note that RawQuerySets have no len method so length filter returns always 0.

To fix this we have implemented a new version of the length filter that will be loaded in your template if you overwrite it.

{% load async_included %}

Note that this templatetag file is async_included, ending in ed.

Examples

Passing an object

{% load async_include %}

{# .. #}

{# Load the template and informs the board object is required for the included template  #}
{% async_include "boards/components/view/current_percentage_of_completion.html" board=board %}

Passing a QuerySet

{% load async_include %}

{# .. #}

{% async_include "boards/components/view/summary.html" board=board member=member next_due_date_cards=next_due_date_cards %}

Customization

Spinner

Overwrite async_include/spinner.html template if you want to change the spinner from fontawesome one (default) by a background image or an image. Otherwise, make sure you are loading fontawesome fonts.

Note that the spinner must have class async_included-spinner. Otherwise, the spinner behavior is going to be unpredictable.

Show/Hide spinner

Including the optional parameter spinner__visible=False when calling the async_include template tag will not show the spinner block.

{% load async_include %}

{# .. #}

{# Will not show the spinner #}
{% async_include "boards/components/view/last_comments.html" board=board spinner__visible=False %}

Customize spinner template per async_include template tag call

Use the optional parameter spinner__template_path to set a different template path for a specific async_include call in your templates.

{% load async_include %}

{# .. #}

{# Will not show the spinner #}
{% async_include "boards/components/view/last_comments.html" board=board spinner__template_path="templates/comments/last_comments_spinner.html" %}

Remember the spinner tag should contain the async_included-spinner class.

Block wrapper html tag

Wrapper tag is div and maybe you don't want that. Set html__tag optional parameter to the name of the tag you need in that particular context.

Example:

{% load async_include %}

{# .. #}

{# Will be replaced by <li></li> block instead of <div></div> #}
{% async_include "boards/components/view/last_comments.html" board=board html__tag='li' %}

Block wrapper html tag class

Customize the wrapper class by passing html__tag__class optional parameter to the template tag.

{% load async_include %}

{# .. #}

{# Will be replaced by <li></li> block instead of <div></div> #}
{# Class last_comments will be added to wrapper class #}
{% async_include "boards/components/view/last_comments.html" board=board html__tag='li' html__tag__class='last_comments' %}

## Request frequency

If do you want to make frequent requests, set request__frequency to the number of seconds you want to make the requests.

Example:

{% load async_include %}

{# .. #}

{# Update the last comments each 60 seconds #}
{% async_include "boards/components/view/last_comments.html" board=board request__frequency=60 %}

Main author

Diego J. Romero-López is a Software Engineer based on Madrid (Spain).

This project is in no way endorsed or related in any way to my past or current employers.

Contact me by email at [email protected].

Contributors

  • Erik Telepovský:
    • Bug fixes.
    • Modern mobile browser support.
    • PyPy configuration fixes.
    • Python3 support.
    • Multi-language support.

django-async-include's People

Contributors

dependabot[bot] avatar diegojromerolopez avatar eriktelepovsky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

django-async-include's Issues

JSON tampering detected - dict of tuples

Hello ,
I experienced an issue with the latest changes.
In case that I am using 'dict of tuples' in the context, it ends with 'JSON tampering detected' message.
The problem seems to be related to checking of checksum of entry in the context. First the checksum which is stored in json is maked by value_as_string' and then it is compared with the checksum maked by ''value'. This comparison was changed in the last commit (from 'value_as_str' to 'value' ) . What was the intension?

Issues with passing data that contains js code, eg rendering plotly graphs

Great work, I tested it with loading images or passing simple strings, but passing strings that contain js seem problematic.
Example, I want to render a plotly graph asynchronously.
On the server side, I am passing a string that contains html and js to render the chart.

# views.py
class MainView(ListView, FormMixin):
    template_name = "src/main_template.html"
    model = DataClass

    def get_context_data(self, **kwargs):
        context = super(SingleFileView, self).get_context_data(**kwargs)

        context['graph_geo'] = create_plotly_offline(fig,
                                        include_plotlyjs=False,
                                        output_type='div')
        return context
# main_template.html
{% async_include "src/second_template.html" graph=graph_geo|safe %}
# second_template.html
{% load async_include %}
{{ graph|safe }}

However this throws a SyntaxError: unterminated string literal because, I think, django will try and render graph_geo (that contains js) right away instead of passing it to the second_template.

This is a snippet from the rendered view:

<script id="script_pages_singlefile_maphtml__3f5f0890d9414cd284075683091124a1" type="text/javascript">
   if (typeof jQuery == 'undefined') {
       if(console) {
           console.error("jQuery is not loaded and is required by async_include. Please, load it in HEAD block.");
       }
   } else {
       $(document).ready(function(){
           var context = {"graph": {"__checksum__": "03be71d38c22287568ad7aff67fc562f", "value_as_str": "<div id=\"01e0b0a1-5f81-4184-8de4-a0fa1917bc8a\" style=\"height: 100%; width: 100%;\" class=\"plotly-graph-div\"></div><script type=\"text/javascript\">window.PLOTLYENV=window.PLOTLYENV || {};window.PLOTLYENV.BASE_URL=\"https://plot.ly\";Plotly.newPlot(\"01e0b0a1-5f81-4184-8de4-a0fa1917bc8a\", [{\"showlegend\": false, \"name\": \"\", \"mode\": \"lines+markers\", \"hoverinfo\": \"none\", \"y\": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], \"x\": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], \"line\": {\"color\": \"rgb(69,200,252)\", \"width\": 4}, \"type\": \"scatter\"}], {}, {\"displayModeBar\": false, \"linkText\": \"Export to plot.ly\", \"showLink\": false})</script>", "type": "safe_value", "value": {"py/object": "django.utils.safestring.SafeText", "py/newargs": {"py/tuple": ["<div id=\"01e0b0a1-5f81-4184-8de4-a0fa1917bc8a\" style=\"height: 100%; width: 100%;\" class=\"plotly-graph-div\"></div><script type=\"text/javascript\">window.PLOTLYENV=window.PLOTLYENV || {};window.PLOTLYENV.BASE_URL=\"https://plot.ly\";Plotly.newPlot(\"01e0b0a1-5f81-4184-8de4-a0fa1917bc8a\", [{\"showlegend\": false, \"name\": \"\", \"mode\": \"lines+markers\", \"hoverinfo\": \"none\", \"y\": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], \"x\": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], \"line\": {\"color\": \"rgb(69,200,252)\", \"width\": 4}, \"type\": \"scatter\"}], {}, {\"displayModeBar\": false, \"linkText\": \"Export to plot.ly\", \"showLink\": false})</script>"]}}}};
           var request_frequency = "once";
           var post_data = {
               path: "pages/singlefile/map.html",
               language_code: "en-us",
               context: context
           };

           // Make request function as an unique name
           make_request__pages_singlefile_maphtml__3f5f0890d9414cd284075683091124a1 = function (){
               // Delete previous content unless it is the spinner, of course
               $("#pages_singlefile_maphtml__3f5f0890d9414cd284075683091124a1").children(":not(.async_included-spinner)").remove();

               // Show the spinner
               // Note that we try to don't change layout in next requests forcing it to have block's final width
               if(request_frequency != "once"){
                   var block_display = $("#pages_singlefile_maphtml__3f5f0890d9414cd284075683091124a1").css("display");
                   $("#pages_singlefile_maphtml__3f5f0890d9414cd284075683091124a1").children(".async_included-spinner").css("display", block_display);
               }else{
                   $("#pages_singlefile_maphtml__3f5f0890d9414cd284075683091124a1").children(".async_included-spinner").show();
               }

               // Make the AJAX request
               $.ajax({
                   type: "POST",
                   url: "/async_include/get",
                   processData: false,
                   contentType: 'application/json',
                   data: JSON.stringify(post_data),
                   success: function(response_data) {
                       if(request_frequency == "once"){
                           $("#pages_singlefile_maphtml__3f5f0890d9414cd284075683091124a1").html(response_data);
                           $("#script_pages_singlefile_maphtml__3f5f0890d9414cd284075683091124a1").remove();
                       }else{
                           $("#pages_singlefile_maphtml__3f5f0890d9414cd284075683091124a1").append(response_data);
                           var block_width = $("#pages_singlefile_maphtml__3f5f0890d9414cd284075683091124a1").width();
                           $("#pages_singlefile_maphtml__3f5f0890d9414cd284075683091124a1").children(".async_included-spinner").width(block_width).hide();
                       }
                   },
                   error: function(response_data){
                       if(request_frequency != "once"){
                           clearInterval(make_request_interval_pages_singlefile_maphtml__3f5f0890d9414cd284075683091124a1_id);
                       }
                   }
               });
           };
           if(request_frequency == "once"){
               make_request__pages_singlefile_maphtml__3f5f0890d9414cd284075683091124a1();
           } else if($.isNumeric(request_frequency) && request_frequency > 0){
               make_request__pages_singlefile_maphtml__3f5f0890d9414cd284075683091124a1();
               make_request_interval_pages_singlefile_maphtml__3f5f0890d9414cd284075683091124a1_id = setInterval(make_request__pages_singlefile_maphtml__3f5f0890d9414cd284075683091124a1, request_frequency*1000);
           }
       });
   }
</script>

<div id="pages_singlefile_maphtml__3f5f0890d9414cd284075683091124a1" class="async_included-block pages_singlefile_maphtml" data-request-function="make_request__pages_singlefile_maphtml__3f5f0890d9414cd284075683091124a1">
   
       <span class="fa fa-spinner fa-spin fa-2x async_included-spinner"></span>


   
</div>

How can we fix this behaviour? Displaying graphs asynchronously is a really needed feature!

The function inserts the main template endlessly instead of the included

There is an issue with the latest version that gets the main template inserted instead of the included.
I am having a survey app where I am trying to include a question template inside of questions template that extends main index.html.

Questions.html

{% extends 'designintelligence/index.html' %} {% block title %}Design Intelligence{% endblock %} {% load staticfiles %} {% block content %} {% load static %} {% load async_include %}

And in order to include first question I have added:
{% async_include "designintelligence/survey/questions/first-question.html" %}

The problem is that instead of including the first-question.html it includes the main template on that place and it looks like this.

In the terminal it keeps sending requests every few seconds (here).

First-question.html is basic html that contains a form for sending user name.

first-question.html

{% load static %}
<form class="form" role="form" action="{% url 'designintelligence:first-question' %}" method="POST" enctype="multipart/form-data">
    {% csrf_token %}
    <div class="mm-survey-page active" data-page="1">
        <div class="mm-survey-content">
            <div class="mm-survey-question">
                ...
            </div>
            <div class="mm-survey-item">
                <input class="input form has-text-centered" type="text" name="name_surname" placeholder="Name and Surname" required>
            </div>
        </div>
    </div>
</form>

Issue with Queryset and decrypt

Hello,
I am experience an error while using the async with a queryset. Looks like that with python3 you have an error in cripto.py-

This is the error I have:


  File "/Users/riccardo/.local/share/virtualenvs/listopro-HigTRYNj/lib/python3.9/site-packages/async_include/crypto.py", line 17, in decrypt
    return data.encode("utf-8")
AttributeError: 'bytes' object has no attribute 'encode'
ERROR 2021-08-19 12:52:03,644 basehttp 6661 123145475231744 "POST /async_include/get HTTP/1.1" 500 22798

bad tzinfo state arg

Hello.

I've just updated jsonpickle to 1.4.2 and I'm getting following error. Any ideas?

Traceback:

File "/home/swida/environment/production/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/home/swida/environment/production/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  115.                 response = self.process_exception_by_middleware(e, request)

File "/home/swida/environment/production/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/home/swida/environment/production/lib/python3.7/site-packages/django/views/decorators/csrf.py" in wrapped_view
  54.         return view_func(*args, **kwargs)

File "/home/swida/environment/production/src/django-async-include/async_include/views.py" in get_template
  25.     json_body = jsonpickle.loads(request.body.decode('utf-8'))

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in decode
  42.     return context.restore(data, reset=reset, classes=classes)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in restore
  155.         value = self._restore(obj)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore
  214.         return restore(obj)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_dict
  555.                 data[k] = self._restore(v)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore
  214.         return restore(obj)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_dict
  555.                 data[k] = self._restore(v)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore
  214.         return restore(obj)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_dict
  555.                 data[k] = self._restore(v)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore
  214.         return restore(obj)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_object
  330.         return self._restore_object_instance(obj, cls)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_object_instance
  392.         instance = self._restore_object_instance_variables(obj, instance)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_object_instance_variables
  460.             instance = self._restore_state(obj, instance)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_state
  465.         state = self._restore(obj[tags.STATE])

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore
  214.         return restore(obj)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_dict
  555.                 data[k] = self._restore(v)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore
  214.         return restore(obj)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_list
  496.         children = [self._restore(v) for v in obj]

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in <listcomp>
  496.         children = [self._restore(v) for v in obj]

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore
  214.         return restore(obj)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_reduce
  237.         reduce_val = list(map(self._restore, obj[tags.REDUCE]))

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore
  214.         return restore(obj)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_dict
  555.                 data[k] = self._restore(v)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore
  214.         return restore(obj)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_object
  330.         return self._restore_object_instance(obj, cls)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_object_instance
  392.         instance = self._restore_object_instance_variables(obj, instance)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_object_instance_variables
  448.         instance = self._restore_from_dict(obj, instance)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_from_dict
  417.             value = self._restore(v)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore
  214.         return restore(obj)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_dict
  555.                 data[k] = self._restore(v)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore
  214.         return restore(obj)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_reduce
  237.         reduce_val = list(map(self._restore, obj[tags.REDUCE]))

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore
  214.         return restore(obj)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_dict
  555.                 data[k] = self._restore(v)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore
  214.         return restore(obj)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/unpickler.py" in _restore_object
  322.             instance = handler(self).restore(obj)

File "/home/swida/environment/production/lib/python3.7/site-packages/jsonpickle/handlers.py" in restore
  196.         return cls.__new__(cls, *params)

Exception Type: TypeError at /async_include/get
Exception Value: bad tzinfo state arg

async_include tag ignores current language

Result of ajax request of async_include tag is always in default language.

Imagine following settings:

USE_I18N = True
LANGUAGES = (
    ('sk', 'Slovak'),
    ('en', 'English'),
)
LANGUAGE_CODE = 'en'

Result of {% async_include 'my_template.html' %} both on http://127.0.0.1:8000/en/ and http://127.0.0.1:8000/sk/ URLs is the same. The {% trans %} values (or any gettext values of model instances) in the my_template.html should be translated on pages with different language than default.

IndexError: list index out of range

Any idea why do I get this? :/

{% async_include 'statistics/widgets/commissions.html' commission_list=commission_list %}
[25/Jan/2018 18:59:33] "POST /async_include/get HTTP/1.1" 200 20193
Internal Server Error: /async_include/get
Traceback (most recent call last):
  File "/Users/erik/env/swida/lib/python3.5/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/Users/erik/src/django/swida/source/async_include/views.py", line 24, in get_template
    json_body = jsonpickle.loads(request.body.decode('utf-8'))
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/__init__.py", line 152, in decode
    return unpickler.decode(string, backend=backend, keys=keys)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 27, in decode
    return context.restore(backend.decode(string), reset=reset)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 120, in restore
    value = self._restore(obj)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 162, in _restore
    return restore(obj)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 419, in _restore_dict
    data[k] = self._restore(v)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 162, in _restore
    return restore(obj)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 419, in _restore_dict
    data[k] = self._restore(v)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 162, in _restore
    return restore(obj)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 419, in _restore_dict
    data[k] = self._restore(v)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 162, in _restore
    return restore(obj)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 251, in _restore_object
    return self._restore_object_instance(obj, cls)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 316, in _restore_object_instance
    return self._restore_object_instance_variables(obj, instance)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 361, in _restore_object_instance_variables
    instance = self._restore_state(obj, instance)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 366, in _restore_state
    state = self._restore(obj[tags.STATE])
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 162, in _restore
    return restore(obj)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 419, in _restore_dict
    data[k] = self._restore(v)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 162, in _restore
    return restore(obj)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 394, in _restore_list
    children = [self._restore(v) for v in obj]
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 394, in <listcomp>
    children = [self._restore(v) for v in obj]
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 162, in _restore
    return restore(obj)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 181, in _restore_reduce
    f, args, state, listitems, dictitems = map(self._restore, reduce_val)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 162, in _restore
    return restore(obj)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 419, in _restore_dict
    data[k] = self._restore(v)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 162, in _restore
    return restore(obj)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 181, in _restore_reduce
    f, args, state, listitems, dictitems = map(self._restore, reduce_val)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 162, in _restore
    return restore(obj)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 419, in _restore_dict
    data[k] = self._restore(v)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 162, in _restore
    return restore(obj)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 243, in _restore_object
    instance = handler(self).restore(obj)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/handlers.py", line 182, in restore
    params = (value,) + tuple([restore(i, reset=False) for i in args[1:]])
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/handlers.py", line 182, in <listcomp>
    params = (value,) + tuple([restore(i, reset=False) for i in args[1:]])
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 120, in restore
    value = self._restore(obj)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 162, in _restore
    return restore(obj)
  File "/Users/erik/env/swida/lib/python3.5/site-packages/jsonpickle/unpickler.py", line 218, in _restore_id
    return self._objs[obj[tags.ID]]
IndexError: list index out of range

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.