Giter Club home page Giter Club logo

django-ajax-forms's People

Contributors

fak3 avatar petrdlouhy avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-ajax-forms's Issues

How to use formSuccessCallback?

I would like to save the form to appear:

Saved successfully!

<script type="text/javascript">
$(function()    {
        $('#email-register-password').validate('{% url "email_password_register" %}', 
            { 
                type: 'p', 
                fields: true, 
                event: 'focusout', 
                fieldSuccessCallback: function(field) {
                    if(field.next("span").length == 0) {
                        field.after("<span><img class='success-ok' src='{% static 'img/ok.png' %}' width='48' height='48'></span>");
                    }
                },
                formSuccessCallback: function(form) {                        

                },
                fieldInvalidCallback: function(field) {
                    if(field.next("span").length > 0) {
                        field.next("span").remove();
                    }
                }
            }
        );
});
</script> 

 <form method="POST" id="email-register-password" class="form form-horizontal" accept-charset="UTF-8" >
                {% csrf_token %}
                {{ form }}
                <div class="modal-footer">
                    <button class="btn" data-dismiss="modal" aria-hidden="true">Fechar</button>
                </div>
            </form>

date json serializable error

Hi,

When you use Modelform and you have (auto_now_add=True)
you have this error:
TypeError: datetime.datetime(2013, 12, 4, 17, 23, 51, 893632, tzinfo=) is not JSON serializable

For correct this:

add :

from django.core.serializers.json import DjangoJSONEncoder
import json

and change in views.py:

def convert_context_to_json(self, context):
        return json.dumps(context, cls=DjangoJSONEncoder)

also like that deprecated use of simplejson is corrected.

(source from http://stackoverflow.com/a/5781657)

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.