Hi,
I'm getting this error "Slug already exists: ClinicProfileReport" consistently when adding two class methods in a model to reports.py. my code is as follows
from clinic.models import ClinicProfile, DoctorProfile
from model_report.report import reports, ReportAdmin
from model_report.utils import avg_column, count_column, sum_column
def district__name_label(report, field):
return ("District")
def locality__name_label(report, field):
return ("Locality")
def town__name_label(report, field):
return ("Town")
class ClinicProfileReport(ReportAdmin):
model = ClinicProfile
fields = [
'name',
'state',
'district__districtnameen',
'town__townnameen',
'locality__localitynameen',
'created_date',
'phone_no',
]
list_filter = ('state',
)
list_order_by = ('created_date',)
list_group_by = ('name',)
list_serie_fields = ('name',)
type = 'chart'
override_field_labels = {
'district__districtnameen': district__name_label,
'town__townnameen': town__name_label,
'locality__localitynameen': locality__name_label,
}
group_totals = {
'name': count_column,
'phone_no': count_column,
}
report_totals = {
'name': count_column,
'phone_no': count_column,
}
chart_types = ('pie', 'column', 'line')
class DoctorProfileReport(ReportAdmin):
model = DoctorProfile
fields = [
'name',
'state',
'district__districtnameen',
'town__townnameen',
'locality__localitynameen',
'created_date',
'phone_no',
]
list_filter = ('state',
)
list_order_by = ('created_date',)
list_group_by = ('name',)
list_serie_fields = ('name',)
type = 'chart'
override_field_labels = {
'district__districtnameen': district__name_label,
'town__townnameen': town__name_label,
'locality__localitynameen': locality__name_label,
}
group_totals = {
'name': count_column,
'phone_no': count_column,
}
report_totals = {
'name': count_column,
'phone_no': count_column,
}
chart_types = ('pie', 'column', 'line')
reports.register('ClinicProfileReport', ClinicProfileReport)
reports.register('DoctorProfileReport', DoctorProfileReport)
please help me to resolve this issue, its working perfectly with one class. where i'm did wrong?