SebYour assumption is too pessimistic. The class name of the (child) instance will always be returned from obj.__class__If instead your method returned the type(obj) you would see the base class name instead of the child class name.Perhaps you need to establish some tests which assert what you expect. I find such an approach very comforting.CheersMike--(Unsigned mail from my phone) -------- Original message --------From: Sébastien Hinderer <sebastien.hinde...@ens-lyon.org> Date: 25/2/24 21:46 (GMT+10:00) To: django-users@googlegroups.com Subject: Re: Data model design questio: graph in database Dear Mike,I will definitely play aroudn with your nice suggestion, but I would liketo share a concern I have. At this stage I am actually unsure how thiswill work.Indeed, suppose a vertex is given as input and one tries to query thedatabase about all the edges that originate from this vertex. The answerwill be under the form of a list of edges, but those will be of classEdge and I assume that their type method will return the Edge classand not the class associated to the actual child.Likewise, once given the list of edges, one has access to the list ofvertices that are neiighbourgs of the original one, but under the formof a list of objects of the base class, Vertex, with still no way to findthe type of the child object that has given rise to that Vertex one.Am I perhaps missing something here?Many thanks in advance and apologies for th likely naïve question,Seb.-- You received this message because you are subscribed to the Google Groups "Django users" group.To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.to view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ZdsadQngSnjTBimQ%40om.localdomain.
-- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/65db3321.050a0220.186e4.d2a8SMTPIN_ADDED_MISSING%40gmr-mx.google.com.