Skip to content

Instantly share code, notes, and snippets.

View antdking's full-sized avatar

Anthony King antdking

View GitHub Profile
@antdking
antdking / forms.py
Last active June 2, 2016 19:50 — forked from mekhami/forms.py
class OrderForm(forms.ModelForm):
class Meta:
model = Order
fields = ['book_title', 'customer', 'internal_design', 'paid', 'start_date']
campaign = forms.ModelMultipleChoiceField(queryset=Campaign.objects.all())
def _save_m2m(self):
super()._save_m2m()
campaign = Campaign.objects.get(pk=self.cleaned_data['campaign'])
"""
Copyright (C) 2015 Fastboot Mobile, LLC. (http://fastbootmobile.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software