Message from Python discussions

December 2018

— This is my source code in django

— 

String returned by __str__ is supposed to be a short one-line description of an object (Order #X (N items)). You can output full order's contents on its editing page.

— So what you mean, I should remove str

— I mean, you can't split that string into multiple lines, not in django admin

— I've looked.. imma use that maybe

— Is there any way to split it up?

— Nope

— Ok thanks

— Oleg could you please help me how i can i remove back side of my date? Because it is too long

— I am sending it

— Look up python datetime formatting

— Ur def __str__ should do the trick, just use some python logic to show less number of words in ur return value

Message permanent page