<commit_before>from django.contrib import admin
from register.models import Apross, DetailApross, Faces, Benefit, DetailBenefit, Radiography


class AprossAdmin(admin.ModelAdmin):
    fields = (
        'patient', 'month', 'year', 'managment_code1',
        'managment_code2', 'managment_code3', 'rx_amount',
    )
admin.site.register(Apross, AprossAdmin)


class DetailAprossAdmin(admin.ModelAdmin):
    fields = (
        'day', 'benefit', 'work_done', 'practic_code',
        'element', 'faces'
    )
admin.site.register(DetailApross, DetailAprossAdmin)


class BenefitAdmin(admin.ModelAdmin):
    fields = (
        'patient', 'month', 'year', 'primary_entity',
        'principal_code', 'managment_code', 'rx_amount',
    )
admin.site.register(Benefit, BenefitAdmin)


class DetailBenefitAdmin(admin.ModelAdmin):
    fields = (
        'day', 'benefit', 'tooth', 'code', 'faces'
    )
admin.site.register(DetailBenefit, DetailBenefitAdmin)


class FacesAdmin(admin.ModelAdmin):
    fields = (
        'name', 'initial'
    )
admin.site.register(Faces, FacesAdmin)


class RadiographyAdmin(admin.ModelAdmin):
    fields = (
        'apross', 'benefit', 'part_number_1', 'finality_1',
        'part_number_2', 'finality_2', 'part_number_3',
        'finality_3'
    )
admin.site.register(Radiography, RadiographyAdmin)<commit_msg>se añade actions de admin<commit_after>from django.contrib import admin
from register.models import Apross, DetailApross, Faces, Benefit, DetailBenefit, Radiography


def apross_create_radiography(modeladmin, request, queryset):
    for bf in queryset:
        Radiography(apross=bf).save()
apross_create_radiography.short_description = "Crear radiografia"

def benefit_create_radiography(modeladmin, request, queryset):
    for bf in queryset:
        Radiography(benefit=bf).save()
benefit_create_radiography.short_description = "Crear radiografia"


class AprossAdmin(admin.ModelAdmin):
    fields = (
        'patient', 'month', 'year', 'managment_code1',
        'managment_code2', 'managment_code3', 'rx_amount',
    )
    actions = [apross_create_radiography]
admin.site.register(Apross, AprossAdmin)


class DetailAprossAdmin(admin.ModelAdmin):
    fields = (
        'day', 'benefit', 'work_done', 'practic_code',
        'element', 'faces'
    )
admin.site.register(DetailApross, DetailAprossAdmin)


class BenefitAdmin(admin.ModelAdmin):
    fields = (
        'patient', 'month', 'year', 'primary_entity',
        'principal_code', 'managment_code', 'rx_amount',
    )
    actions = [benefit_create_radiography]
admin.site.register(Benefit, BenefitAdmin)


class DetailBenefitAdmin(admin.ModelAdmin):
    fields = (
        'day', 'benefit', 'tooth', 'code', 'faces'
    )
admin.site.register(DetailBenefit, DetailBenefitAdmin)


class FacesAdmin(admin.ModelAdmin):
    fields = (
        'name', 'initial'
    )
admin.site.register(Faces, FacesAdmin)


class RadiographyAdmin(admin.ModelAdmin):
    fields = (
        'apross', 'benefit', 'part_number_1', 'finality_1',
        'part_number_2', 'finality_2', 'part_number_3',
        'finality_3'
    )
admin.site.register(Radiography, RadiographyAdmin)
{'fraction_non_alphanumeric': 0.12829469672912036, 'fraction_numerical': 0.0057161003493172435, 'mean_word_length': 4.232558139534884, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7128264', 'n_tokens_mistral': 1092, 'n_tokens_neox': 1068, 'n_words': 187}