Skip to content

Instantly share code, notes, and snippets.

View Forever-Young's full-sized avatar

Anton Novosyolov Forever-Young

View GitHub Profile
@Forever-Young
Forever-Young / gist:70479b8bdc8a96f6bf4851b41ff65c3e
Created February 25, 2017 21:45
Cascading fields example
ModelView
---------
# field1 (->Model1), field2 (->Model2) filtered by field1 values
column_filter_by = ('field2')
form_widget_args = {
'field2': {
'data-filter-by': 'field1',
}
}
# get current network, eg. 192.168.1.0/24
ip addr show dev $(ip route | grep default | cut -d" " -f5) | grep inet | xargs echo | cut -d" " -f2 | xargs ipcalc -n -b | grep Network | xargs echo | cut -d" " -f2