This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def perform_search(request): | |
list = request.POST.getlist('genres') | |
genre_query = Q() | |
author_query = Q() | |
title_query = Q() | |
description_query = Q() | |
liked_books = [] | |
for gen in list: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void writeFile(Context context){ | |
teamMap = generateHashMap(); | |
try{ | |
FileOutputStream outputStream = context.openFileOutput(FILENAME, Context.MODE_PRIVATE); | |
ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream); | |
objectOutputStream.writeObject(teamMap); | |
System.out.println(teamMap.size()); | |
} catch (FileNotFoundException e) { | |
e.printStackTrace(); | |
Toast.makeText(context, "File not found.", Toast.LENGTH_SHORT).show(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package albanese.tony.com.go4lunch.Adapters | |
import albanese.tony.com.go4lunch.DataModels.AppUser | |
import albanese.tony.com.go4lunch.R | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import androidx.recyclerview.widget.RecyclerView | |
import com.firebase.ui.firestore.FirestoreRecyclerAdapter | |
import com.firebase.ui.firestore.FirestoreRecyclerOptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun initializeCoworkerRecyclerView() { | |
//Setup the query. | |
val query = db.collection(COLLECTION_USERS).orderBy("name") | |
val options = FirestoreRecyclerOptions.Builder<AppUser>().setQuery(query, AppUser::class.java).build() | |
adapter = CoworkerListAdapter(options) | |
val recyclerView = activity!!.findViewById<RecyclerView>(R.id.coworker_recycler_view) | |
recyclerView.setHasFixedSize(true) | |
recyclerView.layoutManager = LinearLayoutManager(context) |