@@ -53,7 +53,7 @@ def get_title(self) -> str:
5353 if title := super ().get_title ():
5454 return title
5555
56- return self .model ._meta .model_name .capitalize () + "s"
56+ return self .model .model_options .model_name .capitalize () + "s"
5757
5858 @classmethod
5959 def get_nav_title (cls ) -> str :
@@ -63,14 +63,14 @@ def get_nav_title(cls) -> str:
6363 if cls .title :
6464 return cls .title
6565
66- return cls .model ._meta .model_name .capitalize () + "s"
66+ return cls .model .model_options .model_name .capitalize () + "s"
6767
6868 @classmethod
6969 def get_path (cls ) -> str :
7070 if path := super ().get_path ():
7171 return path
7272
73- return f"{ cls .model ._meta .model_name } /"
73+ return f"{ cls .model .model_options .model_name } /"
7474
7575 def get_template_context (self ) -> dict [str , Any ]:
7676 context = super ().get_template_context ()
@@ -167,20 +167,20 @@ def get_nav_title(cls) -> str:
167167 if cls .title :
168168 return cls .title
169169
170- return cls .model ._meta .model_name .capitalize ()
170+ return cls .model .model_options .model_name .capitalize ()
171171
172172 @classmethod
173173 def get_path (cls ) -> str :
174174 if path := super ().get_path ():
175175 return path
176176
177- return f"{ cls .model ._meta .model_name } /<int:id>/"
177+ return f"{ cls .model .model_options .model_name } /<int:id>/"
178178
179179 def get_fields (self ) -> list [str ]:
180180 if fields := super ().get_fields ():
181181 return fields
182182
183- return [f .name for f in self .object ._meta .get_fields () if f .concrete ]
183+ return [f .name for f in self .object ._model_meta .get_fields () if f .concrete ]
184184
185185 def get_field_value (self , obj : Any , field : str ) -> Any :
186186 try :
@@ -204,14 +204,14 @@ def get_title(self) -> str:
204204 if title := super ().get_title ():
205205 return title
206206
207- return f"New { self .model ._meta .model_name } "
207+ return f"New { self .model .model_options .model_name } "
208208
209209 @classmethod
210210 def get_path (cls ) -> str :
211211 if path := super ().get_path ():
212212 return path
213213
214- return f"{ cls .model ._meta .model_name } /create/"
214+ return f"{ cls .model .model_options .model_name } /create/"
215215
216216
217217class AdminModelUpdateView (AdminUpdateView ):
@@ -230,7 +230,7 @@ def get_path(cls) -> str:
230230 if path := super ().get_path ():
231231 return path
232232
233- return f"{ cls .model ._meta .model_name } /<int:id>/update/"
233+ return f"{ cls .model .model_options .model_name } /<int:id>/update/"
234234
235235 def get_object (self ) -> models .Model :
236236 return self .model .query .get (id = self .url_kwargs ["id" ])
@@ -247,7 +247,7 @@ def get_path(cls) -> str:
247247 if path := super ().get_path ():
248248 return path
249249
250- return f"{ cls .model ._meta .model_name } /<int:id>/delete/"
250+ return f"{ cls .model .model_options .model_name } /<int:id>/delete/"
251251
252252 def get_object (self ) -> models .Model :
253253 return self .model .query .get (id = self .url_kwargs ["id" ])
0 commit comments