معرفی شرکت ها


django-fixtures-command-0.1.0


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

Simple Django command that helps to organize your fixtures
ویژگی مقدار
سیستم عامل -
نام فایل django-fixtures-command-0.1.0
نام django-fixtures-command
نسخه کتابخانه 0.1.0
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Marcin Josiński
ایمیل نویسنده josinski@outlook.com
آدرس صفحه اصلی https://github.com/marcinjosinski/django-fixtures-command
آدرس اینترنتی https://pypi.org/project/django-fixtures-command/
مجوز MIT
# django-fixtures-command [![Actions Status](https://github.com/marcinjosinski/django-fixtures-command/workflows/CI/badge.svg)](https://github.com/marcinjosinski/django-fixtures-command/actions) Simple Django command that helps to organize your fixtures. <p align="center"> <img src="https://github.com/marcinjosinski/django-fixtures-command/blob/main/img/example.png" alt="Example usage of django-fixtures-command " width="738"> </p> ## Usage Add `fixtures.py` files anywhere you want in your Django project. Put there the functions that handle fake data for development purposes. The function must have `fill_` or `flush_` prefix and must be defined in the `fixtures.py` file to be found by `./manage.py fixtures` command. ## Commands Display all available fixtures along with their docstrings: ```./manage.py fixtures --all``` Fill the database with fake data: ```./manage.py fixtures fill <fixture_name>``` Flush data from the database: ```./manage.py fixtures flush <fixture_name>``` ## Example It is convenient to use some tool to generate fake data for fixtures like the `factory_boy` library. ```py def fill_profiles(): """Fill the database with fake user profiles.""" inactive_profile = ProfileFactory.create( user__password=EXAMPLE_PASSWORD, user__is_active=False, ) active_profile = ProfileFactory.create(user__password=EXAMPLE_PASSWORD, user__is_active=True) admin_profile = ProfileFactory.create( user__password=EXAMPLE_PASSWORD, user__is_superuser=True, user__is_staff=True, ) print('Inactive profile:', inactive_profile.user.email, 'password:', EXAMPLE_PASSWORD) print('Active profile:', active_profile.user.email, 'password:', EXAMPLE_PASSWORD) print('Admin profile:', admin_profile.user.email, 'password:', EXAMPLE_PASSWORD) def flush_profiles(): """Remove all user profiles.""" Profile.objects.all().delete() ``` ## Installation Install with pip: `python -m pip install django-fixtures-command` Then add to your installed apps: ```py INSTALLED_APPS = [ ..., 'django_fixtures_command' ] ```


نیازمندی

مقدار نام
>=3.0 Django


زبان مورد نیاز

مقدار نام
>=3.8 Python


نحوه نصب


نصب پکیج whl django-fixtures-command-0.1.0:

    pip install django-fixtures-command-0.1.0.whl


نصب پکیج tar.gz django-fixtures-command-0.1.0:

    pip install django-fixtures-command-0.1.0.tar.gz