This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.forms.models import inlineformset_factory | |
from django.shortcuts import render | |
def container_with_items(request, container_id): | |
ItemFormSet = inlineformset_factory( | |
models.Container, models.Item, form=forms.InlineItemForm, fk_name='container', extra=1 | |
) | |
# Use this to layout the Item forms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# xlsxwriter Cheat Sheet | |
# | |
# xlsxwriter is an awesome package for writing Excel spreadsheets. It's got excellent documentation. And it's got | |
# way more functionality than I need. This cheat sheet contains the basic functionality that I use all the time. | |
# | |
# While it is possible to put formulas in the spreadsheet, I have had some problems with spreadsheets as email attachments | |
# when the spreadsheet has formulas and the email client is on mobile. | |
import xlsxwriter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.forms.models import inlineformset_factory | |
from django.shortcuts import render | |
from django.http import HttpResponseRedirect | |
from django import forms | |
from crispy_forms.helper import FormHelper | |
# The forms --------------------------------------------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import namedtuple | |
# Javascript scripts ----------------------------------------------------------------------------------------------- | |
SELECT_BY_VALUE = \ | |
''' | |
$(arguments[0]).val(arguments[1]); | |
$(arguments[0]).trigger('change'); | |
''' |
OlderNewer