![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A Django app to create and use ReportBro reports with a sample admin. This allows you to generate yours reports using three options: by its code or name from database or JSON template.
A Django app to create, use and export ReportBro reports (free version) with a admin.
INSTALLED_APPS = [
... ,
'django_reportbroD.apps.ReportbrodConfig',
]
path("reportbroD/", include("django_reportbroD.urls", namespace="reportbroD")),
Run python manage.py migrate
to create the models and to migrating to data base.
Start the development server.
Visit the /reportbroD/
URL to create/update/edit/duplicate/remove reports.
Traslations
The next step is optional if you want to use in Spanish and English, otherwise it isn't necessary.
MIDDLEWARE = [
'django.middleware.locale.LocaleMiddleware',
...
],
path("i18n/", include("django.conf.urls.i18n")),
from django_reportbroD.utils import convert_to_base64, convert_list_to_dict, to_dict, export_report_by_code, export_report_by_name, export_report_from_JSON
def generar_pdf(request):
products=Product.objects.all()
#converting in a dictionary
productos=[to_dict(p) for p in products]
imagen= convert_to_base64(products.first().imagen.url, 'jpg')
data={
"productos":productos,
"imagen":imagen
}
code_report= 12
return export_report_by_code(template_code=code_report, data=data, extension="pdf")
def generar_xls(request):
products=Product.objects.all()
#converting in a dictionary
productos=[to_dict(p) for p in products]
imagen= convert_to_base64(products.first().imagen.url, 'jpg')
data={
"productos":productos,
"imagen":imagen
}
return export_report_by_name(template_name="Plantilla de obrero" , data=data, extension="xlsx")
def generar_reporte(request):
products=Product.objects.all()
#converting in a dictionary
productos=[to_dict(p) for p in products]
imagen= convert_to_base64(products.first().imagen.url, 'jpg')
data={
"productos":productos,
"imagen":imagen
}
return export_report_from_JSON(path_json="reporte.json", data=data, extension="xlsx")
# admin.py
from .views import reporte
...
def reportbro(modeladmin, request, queryset):
w=queryset.first()
if w:
return reporte(request, w.code)
reportbro.short_description="Working Report"
@admin.register(Working)
class WorkAdmin(admin.ModelAdmin):
list_display = ("worker","date", "hours","payhorary", "descount", "pay_extra", "pay" )
list_filter=["date", "worker"]
list_display_links = ("worker","date" )
actions=[reportbro]
Parameter >> download = True
In this case, download parameter from export_report_by_code, export_report_by_name and export_report_from_JSON functions must be "True" to avoid any errors when the report format is "pdf".
#views.py
from django_reportbroD.utils import convert_to_base64, convert_list_to_dict, to_dict, export_report_by_code, export_report_by_name, export_report_from_JSON
...
def reporte(request, code):
worker=Worker.objects.filter(code=code).first()
workings=Working.objects.filter(worker=worker)
asistencia= [
{
"date": w.date.date,
"payhorary" : w.payhorary,
"descount" : w.descount,
"pay_extra" : w.pay_extra,
"pay" : w.pay,
}
for w in workings
]
trabajador=to_dict(worker)
trabajador["horary"]=worker.horary.horario()
trabajador["area"]=worker.area.Area()
data={
"worker":trabajador,
"working": asistencia,
"date":datetime.datetime.now()
}
return export_report_by_code(template_code=7, data=data, file="nuevo", download=True)
FAQs
A Django app to create and use ReportBro reports with a sample admin. This allows you to generate yours reports using three options: by its code or name from database or JSON template.
We found that django-reportbroD demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.