小编dhi*_*mar的帖子

导入错误:没有名为django_orm的模块

CredentialsFieldoauth2client.django_orm导入时,我得到:

Import Error: No module named django_orm
Run Code Online (Sandbox Code Playgroud)

我已经安装了先决条件:django-ormpython-oauth2.

python python-2.7 django-1.9

3
推荐指数
1
解决办法
2743
查看次数

DatabaseException:在反序列化时期望一个Map,但是得到了一个java.lang.Long类

这个问题/错误的根本原因是什么?怎么解决?我的数据模型结构不合理吗?或者我是否进行了错误的查询?

//添加新评论

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)

android firebase firebase-realtime-database

3
推荐指数
1
解决办法
4823
查看次数