golf/views/view_export.py
def database(request):
    """
    View function for import export backup dialog in home page
    Exports the database compressed in a zip file
    url: 'exportroundimportplugin/(?P<roundImportPluginId>\d+)$'
    """
    with tempfile.TemporaryDirectory() as tmpdir:
        with zipfile.ZipFile(os.path.join(tmpdir, 'data.zip'), 'x') as datazip:
            datazip.write(settings.DATABASES['default']['NAME'], arcname='db.sqlite3')
        response = FileResponse(open(os.path.join(tmpdir, 'data.zip'), 'rb'))
        response['Content-Disposition'] = ('attachment; filename="db.sqlite3.zip"')
    return response

    View function for import export backup dialog in home page
    Exports the database compressed in a zip file
    url: 'exportroundimportplugin/(?P<roundImportPluginId>\d+)$'
    
View function for import export backup dialog in home page
Exports the database compressed in a zip file
url: 'exportroundimportplugin/(?P\d+)$'
View function for import export backup dialog in home page Exports the database compressed in a zip file url : ' exportroundimportplugin / ( ?P \ d + ) $ '
def database(request):
    with tempfile.TemporaryDirectory() as tmpdir:
        with zipfile.ZipFile(os.path.join(tmpdir, 'data.zip'), 'x') as datazip:
            datazip.write(settings.DATABASES['default']['NAME'], arcname='db.sqlite3')
        response = FileResponse(open(os.path.join(tmpdir, 'data.zip'), 'rb'))
        response['Content-Disposition'] = ('attachment; filename="db.sqlite3.zip"')
    return response
def database ( request ) : with tempfile . TemporaryDirectory ( ) as tmpdir : with zipfile . ZipFile ( os . path . join ( tmpdir , 'data.zip' ) , 'x' ) as datazip : datazip . write ( settings . DATABASES [ 'default' ] [ 'NAME' ] , arcname = 'db.sqlite3' ) response = FileResponse ( open ( os . path . join ( tmpdir , 'data.zip' ) , 'rb' ) ) response [ 'Content-Disposition' ] = ( 'attachment; filename="db.sqlite3.zip"' ) return response
View function for import export backup dialog in home page
Exports the database compressed in a zip file
url: 'exportroundimportplugin/(?P<roundImportPluginId>\d+)$'
View function for import export backup dialog in home page Exports the database compressed in a zip file url : ' exportroundimportplugin / ( ?P<roundImportPluginId > \ d + ) $ '
"""
    View function for import export backup dialog in home page
    Exports the database compressed in a zip file
    url: 'exportroundimportplugin/(?P<roundImportPluginId>\d+)$'
    """
request