You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
column_defs 's foreign_field option breaks for models.OneToOneRel when there is no related_model linking to this obj.
Maybe in columns.py, get_foreign_value has to check if current_path_item is one of the OneToOneRel's name.
To be more specific, here is my test code:
models.py
class ModelA(MyModel):
class Meta:
ordering = ['pk']
class ModelB(MyModel):
modelA = models.OneToOneField(ModelA,
related_name='modelB',
on_delete=models.CASCADE,
null=True, blank=True,
verbose_name="ModelA")
class Meta:
ordering = ['pk']
ajax_datatable_views.py
class ModelA_AjaxDatatableView(AjaxDatatableView):
model = ModelA
column_defs = [
{
"title": "id",
"name": "id",
},
{
"title": "modelB",
"name": "modelB__id",
"foreign_field": "modelB__id",
}
]
p.s. Thank you for this fantastic project
The text was updated successfully, but these errors were encountered:
column_defs
'sforeign_field
option breaks formodels.OneToOneRel
when there is no related_model linking to this obj.Maybe in columns.py,
get_foreign_value
has to check ifcurrent_path_item
is one of theOneToOneRel
's name.To be more specific, here is my test code:
models.py
ajax_datatable_views.py
p.s. Thank you for this fantastic project
The text was updated successfully, but these errors were encountered: