我有以下字符串:-1,856,32,0,0,0.000000,0.0000000,0,0,137,0,0,0,1400,0,101,0,0,0,42,00,0,0,0,0,0,0,00,0,0,0,0,0,554,0-1,841,1,0,0,0.000000,0.0000000,0,0,163,0,0,0,1820,0,120,0,0,0,43,00,0,0,0,0,0,0,00,0,0,0,0,0,517,0然后我使用分隔符-1拆分它,这意味着将有一个由2个元素组成的数组(我们称它为array1)。现在,假设array1的第一个元素我想用\r\n再次拆分它,这将是一个数组(array
所以我有一篇文章,以及对这篇文章的“评论”..评论允许人们回复..你可以回复回复..等等,这意味着最深的树根是N表格外观的快速模型Comments(id,news_id,user_id,body,likes)Replies(id,parent_id)-->idhereis=Comments.idUser(id,username,password)News(id,title,body,image)有没有办法查询PostgresDB给我类似的结果因此Replies表中的所有parent_id为空的内容都是“主要”评论(又名不是回复)。如果可能的话,我希望children字段在自身内部填充(
我在尝试向我的模型添加/发布数据时遇到了问题。这是我在pythonmanage.pyshell中所做的:>>>frombooking.modelsimport*>>>qa=Product.objects.get(id=5)>>>sd=Booking.objects.create(...date_select='2011-11-29',...product_name=qa.name,...quantity=1,...price=qa.price,...totalcost=20,...first_name='lalala',...last_name='sadsd',...contact='