NINJA_LEARN_IR Telegram 769
خب خب خب، کامند inspectdb توی جنگو⚙️
احتمالا به این فکر کردین که چطوری میشه از جدول های یه دیتابیس آماده توی جنگو استفاده کرد. راه حلش این ابزاره.

‏inspectdb چیه
؟
با استفاده از inspectdb، جنگو میتونه ساختار جدول های دیتابیس رو بررسی کنه و یه فایل مدل جنگو(مثل model.py) تولید کنه و توی خروجی نمایش بده. این یعنی دیگه نیاز نیست برای دیتبایس قدیمیتون دستی مدل بنویسید، جنگو اینکارو هم خودش انجام میده.
python manage.py inspectdb > models.py

شما حتی میتونید فقط یه جدول رو بررسی و تبدیل کنید:
python manage.py inspectdb my_table > models.py


این ابزار میتونه توی این مواقع کمکتون کنه:
1️⃣ وقتی روی یه دیتابیس قدیمی یا پروژه ی legacy کار میکنید.
2️⃣ موقع مهاجرت از یه سیستم دیگه به جنگو.
3️⃣ وقتی میخوان بدون نوشتن کلی کد دستی با یه دیتابیس خارجی کار کنید.

نکته مهم⚠️:
کدی که این ابزار تولید میکنه همیشه تمیز و ایده‌آل نیست. بهتره بعد از ساخت، مدل‌ها رو یه دور بازبینی و شخصی‌سازی کنید. جنگو خودش هم توی فایل تولید شده این هشدار رو مینویسه.


⏺️ برای اطلاعات بیشتر میتونید به داکیومنت جنگو مراجعه کنید:
inspectdb در جنگو

#⃣ #django #python #db


🥷🏻 CHANNEL | GROUP
👍15



tgoop.com/ninja_learn_ir/769
Create:
Last Update:

خب خب خب، کامند inspectdb توی جنگو⚙️
احتمالا به این فکر کردین که چطوری میشه از جدول های یه دیتابیس آماده توی جنگو استفاده کرد. راه حلش این ابزاره.

‏inspectdb چیه
؟
با استفاده از inspectdb، جنگو میتونه ساختار جدول های دیتابیس رو بررسی کنه و یه فایل مدل جنگو(مثل model.py) تولید کنه و توی خروجی نمایش بده. این یعنی دیگه نیاز نیست برای دیتبایس قدیمیتون دستی مدل بنویسید، جنگو اینکارو هم خودش انجام میده.

python manage.py inspectdb > models.py

شما حتی میتونید فقط یه جدول رو بررسی و تبدیل کنید:
python manage.py inspectdb my_table > models.py


این ابزار میتونه توی این مواقع کمکتون کنه:
1️⃣ وقتی روی یه دیتابیس قدیمی یا پروژه ی legacy کار میکنید.
2️⃣ موقع مهاجرت از یه سیستم دیگه به جنگو.
3️⃣ وقتی میخوان بدون نوشتن کلی کد دستی با یه دیتابیس خارجی کار کنید.

نکته مهم⚠️:
کدی که این ابزار تولید میکنه همیشه تمیز و ایده‌آل نیست. بهتره بعد از ساخت، مدل‌ها رو یه دور بازبینی و شخصی‌سازی کنید. جنگو خودش هم توی فایل تولید شده این هشدار رو مینویسه.


⏺️ برای اطلاعات بیشتر میتونید به داکیومنت جنگو مراجعه کنید:
inspectdb در جنگو

#⃣ #django #python #db


🥷🏻 CHANNEL | GROUP

BY Ninja Learn | نینجا لرن


Share with your friend now:
tgoop.com/ninja_learn_ir/769

View MORE
Open in Telegram


Telegram News

Date: |

During the meeting with TSE Minister Edson Fachin, Perekopsky also mentioned the TSE channel on the platform as one of the firm's key success stories. Launched as part of the company's commitments to tackle the spread of fake news in Brazil, the verified channel has attracted more than 184,000 members in less than a month. Judge Hui described Ng as inciting others to “commit a massacre” with three posts teaching people to make “toxic chlorine gas bombs,” target police stations, police quarters and the city’s metro stations. This offence was “rather serious,” the court said. Avoid compound hashtags that consist of several words. If you have a hashtag like #marketingnewsinusa, split it into smaller hashtags: “#marketing, #news, #usa. Just at this time, Bitcoin and the broader crypto market have dropped to new 2022 lows. The Bitcoin price has tanked 10 percent dropping to $20,000. On the other hand, the altcoin space is witnessing even more brutal correction. Bitcoin has dropped nearly 60 percent year-to-date and more than 70 percent since its all-time high in November 2021. Ng was convicted in April for conspiracy to incite a riot, public nuisance, arson, criminal damage, manufacturing of explosives, administering poison and wounding with intent to do grievous bodily harm between October 2019 and June 2020.
from us


Telegram Ninja Learn | نینجا لرن
FROM American