restaurant_app/utils.py
def diff_dashtable(data, data_previous, row_id_name="tableid"):

    """Generate a diff of Dash DataTable data.
    Parameters
    ----------
    data: DataTable property (https://dash.plot.ly/datatable/reference)
        The contents of the table (list of dicts)
    data_previous: DataTable property
        The previous state of `data` (list of dicts).

    Returns
    -------
    A list of dictionaries of the changed rows
    """
    df, df_previous = pd.DataFrame(data=data), pd.DataFrame(data_previous)
    for _df in [df, df_previous]:
        assert row_id_name in _df.columns
        _df = _df.set_index(row_id_name)
    mask = df.ne(df_previous)
    changed_rows = df.loc[df[mask].notnull().any(axis=1), :]
    return changed_rows.to_dict(orient='records')
Generate a diff of Dash DataTable data.
    Parameters
    ----------
    data: DataTable property (https://dash.plot.ly/datatable/reference)
        The contents of the table (list of dicts)
    data_previous: DataTable property
        The previous state of `data` (list of dicts).

    Returns
    -------
    A list of dictionaries of the changed rows
    
Generate a diff of Dash DataTable data.
Generate a diff of Dash DataTable data .
def diff_dashtable(data, data_previous, row_id_name="tableid"):
    df, df_previous = pd.DataFrame(data=data), pd.DataFrame(data_previous)
    for _df in [df, df_previous]:
        assert row_id_name in _df.columns
        _df = _df.set_index(row_id_name)
    mask = df.ne(df_previous)
    changed_rows = df.loc[df[mask].notnull().any(axis=1), :]
    return changed_rows.to_dict(orient='records')
def diff_dashtable ( data , data_previous , row_id_name = "tableid" ) : df , df_previous = pd . DataFrame ( data = data ) , pd . DataFrame ( data_previous ) for _df in [ df , df_previous ] : assert row_id_name in _df . columns _df = _df . set_index ( row_id_name ) mask = df . ne ( df_previous ) changed_rows = df . loc [ df [ mask ] . notnull ( ) . any ( axis = 1 ) , : ] return changed_rows . to_dict ( orient = 'records' )
Generate a diff of Dash DataTable data.
Generate a diff of Dash DataTable data .
"""Generate a diff of Dash DataTable data.
    Parameters
    ----------
    data: DataTable property (https://dash.plot.ly/datatable/reference)
        The contents of the table (list of dicts)
    data_previous: DataTable property
        The previous state of `data` (list of dicts).

    Returns
    -------
    A list of dictionaries of the changed rows
    """
None
A list of dictionaries of the changed rows

data
The contents of the table (list of dicts)
The contents of the table ( list of dicts )
data_previous
The previous state of `data` (list of dicts).
The previous state of ` data ` ( list of dicts ) .
row_id_name