django-piston-oauth2 / piston /

import hmac, base64

from django import forms
from django.conf import settings

class Form(forms.Form):
class ModelForm(forms.ModelForm):
    Subclass of `forms.ModelForm` which makes sure
    that the initial values are present in the form
    data, so you don't have to send all old values
    for the form to actually validate. Django does not
    do this on its own, which is really annoying.
    def merge_from_initial(self): = True
        filt = lambda v: v not in
        for field in filter(filt, getattr(self.Meta, 'fields', ())):
  [field] = self.initial.get(field, None)