[Python] How to get list of Classes and etc in a py file or Module ?

2019-01-18 Thread regtech
Hello, I wanna get the list of Classes and other definitions in a python file, I tried : dir( __package__ ) it returns some string, but not get what i needing. Some help me? Thank u! -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscri

OneToOneField value must be a model instance, not a value?

2019-01-02 Thread regtech
Hello everyone! I am a junior who is first using OneToOneField, I found that the value which is giving to the field only could be a instance of the related model, can't be a value of the field which is specifed by the "to_field" ( else django will raise excption ). In the other word, "to_field"

Model crippled when defining properties with "__init__", help!

2018-12-15 Thread regtech
Hello every one! I am using django, today i have a reqirement that was defining some properties on models, so i wrote the "__init__" to do that in my Model class, and then i found that i was lost the code prompting of the model class when i using them by write "MyFooModel( a_filed=...", and the