Q&A
Ask and answer questions to make information more available to wider audiences.
Jamison Blackman @blackmanjamison   04, May 2023 12:00 AM
view all items in the Model
How to view all items in the Model?
answers 1
 
Answer 1
Gunnar Bloxham @bloxhamgunnar   05, May 2023 07:44 PM
The 'all()' function in your interactive shell can be used as follows to display every item in your database:

* Where XYZ is a class you've generated in your models, XYZ.objects.all()

You can either use the get() function or the filter method to remove a specific element from your database, as seen below:

* pk=1 XYZ.objects.filter

* XYZ.objects(id=1)