for user in session.query(User).all():
print(user.profile.full_name) # Запрос к БД на каждой итерацииfor user in session.query(User).options(joinedload(User.profile)).all():
print(user.profile.full_name) # Один запрос с JOINquery = f"SELECT * FROM users WHERE name = '{user_input}'"
cursor.execute(query)query = "SELECT * FROM users WHERE name = %s"
cursor.execute(query, (user_input,))const { test, expect } = require('@playwright/test');
test('Проверка генерации изображения', async ({ page }) => {
await page.goto('https://my-ai-app.com/');
await page.fill('#prompt-input', 'кошка в скафандре на фоне луны'); // Заполняем поле
await page.click('#generate-button'); // Нажимаем кнопку
await page.waitForSelector('#generated-image', { state: 'visible' }); // Ждём, пока появится изображение
await page.screenshot({ path: 'generated-image.jpg' });
console.log('Изображение успешно сгенерировано');
});<style>
/* Styles for the button-like link */
.styled-button {
color: #ffffff !important;
background-color: #008080 !important;
font-size: 19px !important;
border: 2px solid #008080 !important;
border-radius: 30px !important;
padding: 15px 50px !important;
cursor: pointer !important;
margin: 20px 0 !important;
text-decoration: none !important;
display: inline-block !important;
}
/* Styles for the hover state */
.styled-button:hover {
color: #008080 !important;
background-color: #ffffff !important;
}
/* Styles for the active state (optional) */
.styled-button:active {
color: #008080 !important;
background-color: #ffffff !important;
}
/* Container to center the button */
.button-container {
text-align: center !important;
width: 100% !important;
}
</style>
<div class="button-container">
<a class="styled-button" href="https://app.pingera.ru">Попробуйте. Это бесплатно.</a>
</div>