You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -259,7 +259,28 @@ Reverse a named URL pattern to get its actual URL path. Supports both positional
259
259
-`args`: Optional list of positional arguments
260
260
-`kwargs`: Optional dict of keyword arguments
261
261
262
-
### 10. `read_recent_logs`
262
+
### 10. `query_model`
263
+
Query a Django model with read-only operations using the Django ORM manager. This tool allows safe querying of any Django model with filtering, ordering, and pagination.
264
+
265
+
**Arguments:**
266
+
-`app_label`: The Django app label (e.g., "blog")
267
+
-`model_name`: The model name (e.g., "Post")
268
+
-`filters`: Optional dict of field lookups (e.g., `{"status": "published", "featured": true}`)
269
+
-`order_by`: Optional list of fields to order by (e.g., `["-created_at", "title"]`)
270
+
-`limit`: Maximum number of results to return (default: 100, max: 1000)
271
+
272
+
**Returns:**
273
+
- Total count of matching objects
274
+
- Number of results returned
275
+
- List of model instances as dictionaries with all field values
276
+
- For foreign keys, includes both the ID and string representation
277
+
278
+
**Example Queries:**
279
+
- Get all published posts: `filters={"status": "published"}`
280
+
- Get featured posts ordered by date: `filters={"featured": true}`, `order_by=["-created_at"]`
281
+
- Get recent posts with limit: `order_by=["-created_at"]`, `limit=10`
282
+
283
+
### 11. `read_recent_logs`
263
284
Read recent log entries with optional filtering by log level (DEBUG, INFO, WARNING, ERROR, CRITICAL).
264
285
265
286
### Prompts
@@ -301,6 +322,9 @@ Once configured, you can ask your AI assistant questions like:
301
322
- "What's the value of the DEBUG setting?"
302
323
- "What's the URL for blog post with ID 5?"
303
324
- "Reverse the 'post_detail' URL pattern with pk=10"
325
+
- "Show me all published blog posts"
326
+
- "Get the 10 most recent posts ordered by creation date"
327
+
- "Find all featured posts in the blog"
304
328
- "Show me recent error logs"
305
329
306
330
**Using Prompts:**
@@ -316,6 +340,9 @@ The project includes a comprehensive test suite and a fixture Django project for
0 commit comments