Hi,

I was asking on discord what others use as a __repr__ naming convention for 
models and someone suggested:

def __repr__(self):
    return f'<{self.__class__.__name__} pk={self.pk}>'

https://discord.com/channels/159039020565790721/159041895077642251/855456770548564018

Feels like it should be the default for a Django model. Are there any 
implications for changing it to this?

Regards,

Fabian

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/8da8ae9b-b13d-4c05-9634-543cd4e1cbe3n%40googlegroups.com.
  • Cha... Fabian Jarrett
    • ... 'Adam Johnson' via Django developers (Contributions to Django itself)

Reply via email to