- Where Developers Learn, Share, & Build Careers


  1. Why would I create a recursive relationship?
  2. Is it like the above?
     class a class (models.model): eiffel = model.   

    1. When you use the same model structure, If the father and child want to node, you may need to make a recurring relationship. For example, if you have any comments with text, data and user_id:

        class comment (models.model): text = models.TextField () create_date_time = models.DateTimeField () parent_comment = Models.ForeignKey ('self')    
    2. I think yes (you can try testing it), but this is not a good form If you change the name of a class, then you have to change the string value in the brackets. If you use 'self' then you do not do this headache.

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -