PacktLib: Django JavaScript Integration: AJAX and jQuery

Django JavaScript Integration: AJAX and jQuery

Credits

Foreword

About the Author

About the Reviewers

www.PacktPub.com

Preface

jQuery and Ajax Integration in Django

Ajax and the XMLHttpRequest object

A look at Django

Setting JavaScript and other static content in place

Summary

jQuery—the Most Common JavaScript Framework

jQuery and basic Ajax

jQuery Ajax facilities

jQuery as a virtual higher-level language

A closure-based example to measure clock skew

Case study: A more in-depth application

Summary

Validating Form Input on the Server Side

The standard lecture: low-level validation

The Django way of validation

Validation as demanding that assumptions be met

Making assumptions and demanding that users conform

Better validation may be less validation

Summary

Server-side Database Search with Ajax

Searching on the client side and server side

Handling databases through Django models

Models for an intranet employee photo directory

Searching our database

A tour of Django persistence facilities

Summary

Signing Up and Logging into a Website Using Ajax

admin.py: administrative functions called once

functions.py: project-specific functions, including our @ajax_login_required decorator

views.py: functions that render web pages

style.css: basic styling for usability

search.html: a template for client-side Ajax

The Django admin interface

Summary

jQuery In-place Editing Using Ajax

Including a plugin

A template handling the client-side requirements

Summary

Using jQuery UI Autocomplete in Django Templates

Adding autocomplete: first attempt

A real-world workaround

Refining our solution further

Summary

Django ModelForm: a CSS Makeover

"Hello, world!" in ModelForm

Expanding and customizing the example

Customizing ModelForm pages' appearance

Going under ModelForm's hood

An excellent "stupid" question: where's the e-mail slot?

Summary

Database and Search Handling

Moving forward to an AHAH solution

Summary

Tinkering Around: Bugfixes, Friendlier Password Input, and a Directory That Tells Local Time

Minor tweaks and bugfixes

Handling password input in a slightly different way

A directory that includes local timekeeping

Summary

Usability for Hackers

Usability begins with anthropology… and Django hackers have a good start on anthropology

Anthropological usability techniques

Focus groups: cargo cult research for usability

Anthropological observation: the bedrock of usability

Applying this foundation to usability

It's just like (hard) debugging

Lessons from other areas

Understanding the user

Python and usability

What to do in the concrete

Further reading

Summary

Debugging Hard JavaScript Bugs

Debugging Hard JavaScript Bugs

Debugging Hard JavaScript Bugs

Debugging Hard JavaScript Bugs

Index