@thedevs · Post #1984 · 19.07.2022 г., 06:41
Things you should know about databases. #article#databases @thedevs https://kutt.it/xx2Z3i
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #381 · 23 окт.
Установить свойства виджета в PySide можно не только через соответствующие методы и конструктор класса. Можно их изменять с помощью метода setProperty по имени. btn = QPushButton("Click Me") btn.setProperty("flat", True) Это аналогично вызову btn.setFlat(True) Если указать несуществующее свойство, то оно просто создается btn.setProperty("btnType", "super") Получить его значение можно методом .property(name) btn_type = btn.property("btnType") Когда это может быть полезно? ▫️Можно просто хранить какие то данные в виджете и потом их доставать обратно widget = QWidget() widget.setProperty('my_data', 123) print(widget.property('my_data')) ▫️ Назначая эти свойства разным виджетам можно потом отличить виджеты во время итераци по ним. Например, найти все кнопки со свойством my_data="superbtn". Но ведь вместо кастомного свойства можно использовать objectName, будет тот же результат. Да, но y ObjectName есть ограничение - только строки. ▫️ Если нам потребуется не просто поиск а, например, сортировка по числу, то свойства позволяют нам это сделать. Поддерживается любой тип данных widget.setProperty('my_data', {'Key': 'value'}) widget.setProperty('order', 1) all_widgets.sort(key=w: w.property('order')) Но ведь Python позволяет всё вышеперечисленное сделать простым созданием атрибута у объекта widget.order = 1 widget.my_data = 123 Да, но я думаю что не надо объяснять почему не стоит так делать. К тому же, если у виджета нет свойства то метод .property(name) вернет None, а отсутствующий атрибут выбросит исключение. ▫️ Действительно полезное применение кастомным свойствам - контроль стилей. Здесь атрибутами не обойтись, нужны именно свойства. Дело в том, что в селекторах стилей можно указывать конкретные свойства виджетов на которые следует назначать стиль. Просто запустите этот код from PySide2.QtWidgets import * if __name__ == "__main__": app = QApplication([]) widget = QWidget(minimumWidth=300) layout = QVBoxLayout(widget) btn1 = QPushButton("Action 1") btn2 = QPushButton("Action 2") btn3 = QPushButton("Action 3", flat=True) layout.addWidget(btn1) layout.addWidget(btn2) layout.addWidget(btn3) # добавим кастомное свойство одной кнопке btn1.setProperty("btnType", "super") # добавляем стили widget.setStyleSheet( """ QPushButton[btnType="super"] { background-color: yellow; color: red; } QPushButton[flat="true"] { color: yellow; } """ ) widget.show() app.exec_() С помощью селектора мы избирательно назначили стили на конкретные кнопки. Как получить список всех кастомный свойств? Функция получения списка кастомных свойств отличается от получения дефолтных. def print_widget_dyn_properties(widget): for prop_name in widget.dynamicPropertyNames(): property_name = prop_name.data().decode() property_value = widget.property(property_name) print(f"{property_name}: {property_value}") #tricks#qt
Пребарај: #databases
@thedevs · Post #1984 · 19.07.2022 г., 06:41
Things you should know about databases. #article#databases @thedevs https://kutt.it/xx2Z3i
Hashtags
@repo_science · Post #3374 · 30.06.2023 г., 14:57
#python#databases 🐍 Advanced Python: Working with multiple databases Description Build and connect Python Application to multiple databases 🔗Link ----- Main channel: @repo_science Coupons: @freecoupons_reposcience -----
Hashtags
@repo_science · Post #3265 · 04.06.2023 г., 22:32
#python#databases 🐍 Advanced Python: Practical Database Examples Level up as a Python developer working with databases in this advanced, skills-based course. 🔗Link ----- Main channel:@repo_science Coupons: @freecoupons_reposcience -----
Hashtags
@repo_science · Post #4219 · 20.10.2024 г., 21:14
#free#Databases 🎟 2024 Complete SQL Bootcamp from Zero to Hero in SQL 👥Students: 43024 ⭐️Ratings: 4.12 ⏳ 4.5 total hours 🌐 en_US 🗒 Limited coupons (639) 🎫 100% OFF - 💵0💲 ----- Coupons:@freecoupons_reposcience ----- ⭐️ This message was automated by 🔗n8n
Hashtags
@repo_science · Post #3381 · 03.07.2023 г., 00:51
#databases#SQL SQLBolt ¿Quieres aprender SQL de forma práctica y desde cero? SQLBolt es un recurso para devs con: ◆ Ejercicios interactivos y sencillos ◆ Ejemplos desde cero ◆ De SELECT a crear tus propias tablas ◆ 18 lecciones para aprender Es un recurso 100% gratuito. 🔗Link ----- Main channel: @repo_science Coupons: @freecoupons_reposcience -----
Hashtags
@repo_science · Post #3322 · 19.06.2023 г., 22:42
#databases#sql 🛠 SQL Server 2022 Administration Description Looking to get up to speed with the latest features of SQL Server 2022? In this course, join database analyst and trainer Eric Johnson as he covers the fundamental skills, techniques, and tools required to manage SQL Server 2022 in any development environment, regardless of your current level of experience. Learn about the new features available in the latest version of SQL Server as well as how to provision and secure Azure databases, design SQL Server tables, and tune and optimize SQL to meet your own unique needs. Throughout the course, Eric explains the relevant concepts and methodologies of managing and automating SQL Server databases, showing you how to apply what you’ve learned in a series of ongoing visual demonstrations designed to help you get hands-on practice and start building more advanced skills. 🔗Link ----- Main channel:@repo_science Coupons:@freecoupons_reposcience -----
Hashtags
@repo_science · Post #3402 · 07.07.2023 г., 00:57
#databases#MongoDB 💼 Learning MongoDB Get started with MongoDB. Learn how to use this popular nonrelational database to power your full-stack development workflow. ⏳2h 44m 🗣Justin Jenkins 🔗Link ----- Main channel:@repo_science Coupons: @freecoupons_reposcience -----
Hashtags
@repo_science · Post #3423 · 11.07.2023 г., 14:22
#Python#databases#sql 🐍 Data Science Fundamentals with Python and SQL Description Data science is one of the hottest professions of the decade, and the demand for data scientists who can analyze data and communicate results to inform data driven decisions has never been greater. This Specialization from IBM will help anyone interested in pursuing a career in data science by teaching them fundamental skills to get started in this in-demand field. 🗣Coursera 🔗Link ----- Main channel:@repo_science Coupons:@freecoupons_reposcience -----
Hashtags
@repo_science · Post #3158 · 09.05.2023 г., 20:18
#databases#SQL#Python 🐍 Practical SQL with Python in 3 Days using SQLite, MySQL and PostgreSQL 🔗Link ⭐Curso recomendado ----- Main channel: @repo_science Coupons: @freecoupons_reposcience -----
Hashtags
@repo_science · Post #3204 · 19.05.2023 г., 03:28
#databases#GraphQL 💾 Building Web APIs with GraphQL - The Complete Guide Become an expert in one of the most exciting web APIs framework with this practical, hands-on course 🔗Link ----- Main channel: @repo_science Coupons: @freecoupons_reposcience -----
Hashtags
@repo_science · Post #3376 · 30.06.2023 г., 22:25
#databases#sql 💾 Curso de SQL desde Cero (DALTO) 📹#youTube 🔗Link ----- Main channel: @repo_science Coupons:@freecoupons_reposcience -----
Hashtags
@githubtrending · Post #14933 · 09.07.2025 г., 12:30
#go#databases#genai#llms#mcp The MCP Toolbox for Databases helps developers connect AI agents to databases more easily and securely. It simplifies the process by handling complex tasks like connection pooling and authentication, allowing you to integrate databases with AI agents using minimal code. This toolbox supports the Model Context Protocol (MCP), which standardizes how AI interacts with external tools. By using MCP Toolbox, you can automate database tasks, query databases using natural language, and generate context-aware code, all of which save time and improve development efficiency. https://github.com/googleapis/genai-toolbox
Hashtags