CredentialsField从oauth2client.django_orm导入时,我得到:
Import Error: No module named django_orm
Run Code Online (Sandbox Code Playgroud)
我已经安装了先决条件:django-orm和python-oauth2.
这个问题/错误的根本原因是什么?怎么解决?我的数据模型结构不合理吗?或者我是否进行了错误的查询?
//添加新评论
String comment = medit.getText().toString();
Comment newComment = new Comment(user,comment,postKey);
db.child("Post-Comments").child(postKey).push().setValue(newComment);
Run Code Online (Sandbox Code Playgroud)
//使用FirebaseRecyclerView和片段检索帖子中的所有评论
DatabaseReference mRef = db.child("Post-Comments").child(postKey).getRef();
adapter = new FirebaseRecyclerAdapter<Comment, myViewHolder> (Comment.class,
R.layout.comment_list_layout,myViewHolder.class, mRef)
{
@Override
protected void populateViewHolder(myViewHolder viewHolder,
Comment model, int position) {
viewHolder.bindToComments(model);
}
};
rlm2 = new LinearLayoutManager(getActivity());
rv2.setLayoutManager(rlm2);
rv2.setAdapter(adapter);
Run Code Online (Sandbox Code Playgroud)
//评论类
public class Comment {
public String comment;
public String reactUserId;
public Map<String,String> created_on;
public String postKey;
public Comment() {
}
public Comment(String reactUserId, String comment, String postKey) {
this.reactUserId = reactUserId;
this.postKey = postKey; …Run Code Online (Sandbox Code Playgroud)