A shared folder with AI prompts and code snippets
From workspace: Manus
Team: Main
Total snippets: 8
8 snippets
import unittest from models import Task class TaskModelTests(unittest.TestCase): def test_task_creation(self): task = Task(title="Test Task", description="Test Description") self.assertEqual(task.title, "Test Task") ...
Manus AI can also generate automated tests for our Flask application.
import unittest from app import app class FlaskAppTests(unittest.TestCase): def setUp(self): self.app = app.test_client() self.app.testing = True def test_create_task(self): response = self.app.post('/tasks',...
from flask import Blueprint, request, jsonify from models import db, Task task_routes = Blueprint('task_routes', __name__) @task_routes.route('/tasks', methods=['POST']) def create_task(): data = request.get_json() new_task =...
from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() class Task(db.Model): id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String(80), nullable=False) description = db.Column(db.String(200), nullable=True)
from flask import Flask from routes import task_routes app = Flask(__name__) app.register_blueprint(task_routes) if __name__ == "__main__": app.run(debug=True)
Using Manus AI, we can generate the necessary code for our Flask application. Manus AI will create the project structure, Flask routes, and database models.
my_flask_app/ ├── app.py ├── models.py ├── routes.py ├── requirements.txt └── tests/ ├── test_app.py └── test_models.py
First, we’ll define the requirements for a simple Flask application that manages a list of tasks. The application will have the following features:
- Create a new task - Retrieve all tasks - Update a task - Delete a task
- Be Specific: Clearly define the task and expected output. - Provide Context: Include relevant details such as project requirements, technologies, and frameworks. - Iterate: Refine your prompt based on the initial response to get more accurate...