Saravanan666/pypi-org huggingface dataset:
Package: django-persiandate-widget
ï»¿=====ÙˆÛŒØ¯Ø¬Øª ÙˆØ±ÙˆØ¯ ØªØ§Ø±ÛŒØ® Ø¬Ù„Ø§Ù„ÛŒ Ø¯Ø± Ø¬Ù†Ú¯Ùˆ=====Ø¯Ø± Ø¨Ø¹Ø¶ÛŒ Ù…ÙˆØ§Ù‚Ø¹ Ù…Ø·Ù„ÙˆØ¨ Ø§Ø³Øª Ú©Ù‡ Ø¨Ø±Ø§ÛŒ Ú©Ø§Ø¯Ø± ÙˆØ±ÙˆØ¯ Ø§Ø·Ù„Ø§Ø¹Ø§Øª ØªØ§Ø±ÛŒØ® Ø¨Ø¯ÙˆÙ† Ù†ÛŒØ§Ø² Ø¨Ù‡ Ø¯Ø§Ù†Ø´ Ú©Ø§Ø±Ø¨Ø± ØªØ§Ø±ÛŒØ® Ø¨Ù‡ ØµÙˆØ±Øª Ù…Ø·Ù„ÙˆØ¨ Ø¨Ù‡ Ø³Ø±ÙˆØ± Ø§Ø·Ù„Ø§Ø¹ Ø¯Ø§Ø¯Ù‡ Ø´Ø¯Ù‡ Ùˆ Ø«Ø¨Øª Ø´ÙˆØ¯ØŒ Ø¯Ø± ÙˆØ§Ù‚Ø¹ Ù‡Ø¯Ù� Ø§ØµÙ„ÛŒ Ø³Ø§Ø®Øª Ø§ÛŒÙ† ÙˆÛŒØ¯Ø¬Øª Ù†Ù…Ø§ÛŒØ´ ØªØ§Ø±ÛŒØ® Ø¨Ù‡ Ø´Ú©Ù„ Ø´Ù…Ø³ÛŒ Ùˆ Ù‡Ù…Ú†Ù†ÛŒÙ† Ø³Ø§Ø²Ú¯Ø§Ø±ÛŒ Ø¢Ù† Ø¨Ø§ Ù…Ø¯Ù„ ØªØ§Ø±ÛŒØ® Ù‡Ø§ÛŒ Ù‚Ø¨Ù„ÛŒ Ø§Ø³ØªØŒ Ø§ÛŒÙ† ÙˆÛŒØ¯Ø¬Øª Ø¨Ø¯ÛŒÙ† Ú¯ÙˆÙ†Ù‡ Ø¹Ù…Ù„ Ù…ÛŒ Ú©Ù†Ø¯ Ú©Ù‡ Ø§Ø·Ù„Ø§Ø¹Ø§Øª Ø¯Ø±ÙˆÙ† Ø®ÙˆØ¯ Ø±Ø§ Ø¨Ù‡ Ù‚Ø§Ù„Ø¨ Ø´Ù…Ø³ÛŒ Ø¨Ù‡ Ú©Ø§Ø±Ø¨Ø± Ù†Ù…Ø§ÛŒØ´ Ù…ÛŒ Ø¯Ù‡Ø¯Ø¨Ø¯ÛŒÙ† Ù…Ø¹Ù†ÛŒ Ú©Ù‡ Ø¯Ø± ØµÙˆØ±ØªÛŒ Ú©Ù‡ Ø§Ø² Ø·Ø±Ù� Ø³Ø±ÙˆØ± Ø§Ø·Ù„Ø§Ø¹Ø§Øª Ø§ÙˆÙ„ÛŒÙ‡ Ø§ÛŒ Ø¨Ù‡ Ú©Ø§Ø¯Ø± ÙˆØ§Ø±Ø¯ Ø´ÙˆØ¯ Ø¢Ù† Ø§Ø·Ù„Ø§Ø¹Ø§Øª Ø§Ø² Ù…ÛŒÙ„Ø§Ø¯ÛŒ Ø¨Ù‡ Ø´Ù…Ø³ÛŒ ØªØ¨Ø¯ÛŒÙ„ Ù…ÛŒ Ø´ÙˆØ¯Ø¯Ø± ØµÙˆØ±Øª Ø¹Ø¯Ù… ÙˆØ¬ÙˆØ¯ Ø¢Ù† Ù†ÛŒØ² ØªØ§Ø±ÛŒØ® Ø§Ù…Ø±ÙˆØ² Ù†Ù…Ø§ÛŒØ´ Ø¯Ø§Ø¯Ù‡ Ù…ÛŒ Ø´ÙˆØ¯Ù‡Ù…Ú†Ù†ÛŒÙ† Ø§ÛŒÙ† ÙˆÛŒØ¯Ø¬Øª Ø¯Ø± Ø­ÛŒÙ† Ø«Ø¨Øª Ø¯Ø§Ø¯Ù‡ ÛŒ Ø®ÙˆØ¯ Ù†ÛŒØ² Ø¯ÙˆØ¨Ø§Ø±Ù‡ Ø¢Ù† Ø±Ø§ Ø§Ø² Ù‚Ø§Ù„Ø¨ Ø´Ù…Ø³ÛŒ Ø¨Ù‡ Ù…ÛŒÙ„Ø§Ø¯ÛŒ ØªØ¨Ø¯ÛŒÙ„ Ù…ÛŒ Ú©Ù†Ø¯ Ùˆ Ø¨Ø¯ÛŒÙ† ØªØ±ØªÛŒØ¨ ØªØ§Ø±ÛŒØ® Ø¯Ø± Ø¬Ù†Ú¯Ùˆ Ø¨Ø§ Ù�Ø±Ù…Øª ØµØ­ÛŒØ­ Ø°Ø®ÛŒØ±Ù‡ Ù…ÛŒ Ø´ÙˆØ¯Ø¨Ø±Ø§ÛŒ Ø´Ø±ÙˆØ¹-----------1.Install this package from here or python package index::python -m pip install django-persiandate-widget2. Add "persiandate-widget" to your INSTALLED_APPS setting like this::INSTALLED_APPS = (...'persiandate',)3. Include the PersianDateInput in your project forms.py like this::from django import formsfrom persiandate.widgets import PersianDateInputclass my_form(forms.Form)...my_date = forms.DateField(widget=PersianDateInput)...Ù†ÛŒØ§Ø²Ù…Ù†Ø¯ÛŒ Ù‡Ø§-----------1.10<jquery<2Ù†Ú©Ø§Øª-----------Jquery javascript file must be included before the datefield or the widget will not work
Package: django-persistent-file-widget
A django form file widget that persists between erroneous form submissions!UsageRunpip installdjango-persistent-file-widgetor placepersistent_widgeton your Python path.Addpersistent_widgetto your list ofINSTALLED_APPS.There are two widgets available,persistent_widget.widgets.PersistentFileWidgetandpersistent_widget.widgets.PersistentImageWidget.  The latter will display a thumbnail ifsorl.thumbnailis installed.
Package: django-persistent-filters
Django Persistent FiltersDjango Persistent Filters is a Python package which provide a django middleware that take care to persist the
querystring in the browser cookies or in the Django Request object.If you have a ListView with a Form for filter the objects, this package is perfect for you!InstallationUse the package managerpipto install:pipinstalldjango-persistent-filtersUsagePut the middleware in thesettings.pyfile:MIDDLEWARE=[...,"persistent_filters.middleware.PersistentFiltersMiddleware"]If you want to store filters in the Request object instead Cookies, add in thesettings.pyfile:PERSISTENT_FILTERS_IN_REQUEST=TrueAdd the urls with a filter form insettings.pyfile:PERSISTENT_FILTERS_URLS=[# You can use name urlsreverse_lazy("user:list"),# or you can write the path without domain"/user/list"]Add in the form the button for reset filters:<buttontype="submit"name="reset-filters">Reset</button>
Package: django-persistent-messages
# Persistent Messages-like Framework for DjangoPersisent, dismissable, targeted, messages framework for Django apps## STATUSAlpha - pls do not use. This README is six years old.## BackgroundDjango messages are great for one-off notifications to users, but notfor persistent notification banners. From the [officialdocumentation](https://docs.djangoproject.com/en/1.11/ref/contrib/messages/)on the Django messages framework:> Quite commonly in web applications, you need to display a one-time> notification message to the user after processing a form or some other> types of user input. [...] The messages framework allows you to> temporarily store messages in one request and retrieve them for> display in a subsequent request (usually the next one).These one-time messages are usually dynamic, created within a viewfunction, to alert the user to something that has just happened. Thisproject is designed to extend the pattern to support configurable andpersistent messages to users. The canonical use case for this is the EUCookie warning. This appears to everyone (logged in or not) until theuser explicitly dismiss it. It is not related to any specific actionthat the user has taken (beyond visiting the site for the first time),and it persists across all requests.## Requirements-   Messages can be managed via the admin site-   The message can contain HTML (specifically href links)-   The message can be categorised (e.g. INFO | WARNING)-   The message can be targeted to appear to the following groups:-   All users (inc. anonymous)-   Authenticated users only-   Specific user groups only-   The message can be marked as dismissable-   The message can be enabled / disabled-   The message can expire (do not show after {{datetime}})-   Track message dismissals## Use cases-   As the marketing team I would like to notify users of an event / activity-   As the tech team I would like to alert users to platform maintenance-   As the EU I would like to annoy people with a message about cookies## Technical implementation1. Print out all messages targeted at a user```python# live == enabled, not expired, not-dismissed, targeted at userfor m in PersistentMessage.objects.for_user(user).active():print(m.message)```2. Display messages in a template using template context```html<body>{% for m in persistent_messages %}<div class="{{m.extra_tags}}">{{ m.message }}</div>{% endfor %} ...</body>```
Package: django-persistent-settings
Django Persistent SettingsDjango Persistent Settings helps you store, retrieve and update platform specific settings in Django and provides many ways in setting retrieval such as request injection or template tags. It is inspired by Laravel'sakaunting/settingpackage.BuildCoveragemasterdevelopmentDocumentationPlease refer tothe documentationto get information about how to utilize this library.LicenseLicensed under the terms ofApache License 2.0.
Package: django-pev
Django Postgres Explain Visualizer (Django-PEV)This tool captures sql queries and uploads the query plan to postgresql explain visualizer (PEV) bydalibo. This is especially helpful for debugging slow queries.This tool also exports a graphical UI similar topgherobut is embedded within your django app.Installationpip install django-pevAdd to your urls# urls.py
from django.urls import include, path

urlpatterns = [
    # ....

    path('django-pev/', include(('django_pev.urls', 'django_pev'), namespace='django_pev')),
]Add to your installed apps# settings.py

INSTALLED_APPS = [
    # ...
    "django_pev"
]UsageWrap some code with the explain context manager. All sql queries are captured
alongside a stacktrace (to locate where it was called). The slowest query is accessible via.slowest.importdjango_pevfromdjango.contrib.auth.modelsimportUserwithdjango_pev.explain()ase:# Every SQL query is capturedlist(User.objects.filter(email='test@test.com').all())# Rerun the slowest query with `EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON)`pev_response=e.slowest.visualize(# By default the text of the query is not uploaded for security reasonsupload_query=True,# Set to false if the query is slow and you want only an explainanalyze=True,# Give a helpful title for the uploaded query plantitle="Measuring email filter",)print(pev_response.url)# View the postgres explain visualizatione.slowest.visualize_in_browser()# View the stack trace of the slowest queryprint(e.slowest.stacktrace)# Delete the plan hosted on https://explain.dalibo.compev_response.delete()How to debug a slow endpoint in productionIf you have access topython manage.py shellon the production server;
you can run the following code snippet to get an explain plan uploaded. In general this technique is all types of profiling.importdjango_pevfromdjango.contrib.auth.modelsimportUserfromdjango.testimportClientasTestClientclient=TestClient()# Authenticationclient.force_login(User.objects.get(id=1))url="/some_slow_url"withdjango_pev.explain()ase:response=client.get(url)print(e.slowest.visualize(title=f"Fetching{url}"))TODOAdd migration to ensure pg_stats_statement_info is correctDo not crash when its not availableAdd explain tab
= [ ] Add index suggesterDisclaimerCredit goes to Pierre Giraud (@pgiraud) for PEV2 and Alex Tatiyants (@AlexTatiyants) for the original pev tool.IN NO EVENT SHALL DALIBO BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF DALIBO HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.DALIBO SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND DALIBO HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
Package: django-pf-billing
pf_billingpf_billingis a django-based billing module, which covers KakaoPay and KGMobilians.(pfstands for plabfootball)🚀 Quick start1. install django-pf-billingpipinstalldjango-pf-billingIt will install following dependencies if not installedrequestsuser-agent2. Add "pf_billing" to your INSTALLED_APPS setting like this# settings.pyINSTALLED_APPS=[...'pf_billing',]KAKAOPAY_CID="Your kakaopay cid"KAKAOPAY_APP_ADMIN_KEY="Your kakao app admin key"3. Runpython manage.py migrateto create a Billing model.4. Start the development serverneed the Admin app enabledvisithttp://127.0.0.1:8000/admin/to see billing admin🛠 How to usefrompf_billing.interfaceimportBillingAction# 1) KakaoPaybilling=BillingAction.set_pg("KakaoPay")# 2) KGMobiliansbilling=BillingAction.set_pg("KGMobilians")# readyresponse=billing.ready(partner_user_id="190324",partner_order_id="K202109301340",item_name="테스트 상품",total_amount=10000,quantity=1,# 결제 성공 시, 카카오페이 서버에서 운영 중인 서버로 콜백 가능한 엔드포인트approval_url="http://example.com/billing/result/success",# 결제 취소 시, 카카오페이 서버에서 운영 중인 서버로 콜백 가능한 엔드포인트cancel_url="http://example.com/billing/result/cancel",# 결제 실패 시, 카카오페이 서버에서 운영 중인 서버로 콜백 가능한 엔드포인트fail_url="http://example.com/billing/result/fail",)# approveresponse=billing.approve(partner_user_id="190324",partner_order_id="K202109301340",pg_token="YKDOEKCDKSLKNF",transaction_id="TID-n3jdks2lajs",)# cancel(partial/all)response=billing.cancel(transaction_id="n3jdks2lajs",cancel_amount=10000,)# track statusresponse=billing.track(transaction_id="n3jdks2lajs",)⭐️ Note1. Billing Model will be created in your database. Keep in mind that model or db_table name conflict.2. Register your domain in Kakao developers.https://developers.kakao.com/console/app/364537/config/platform
Package: django-pfx
Django PFXDjango PFX is a toolkit designed to streamline the development of RESTful APIs
using the Django framework, leveraging views and the ORM (Object-Relational Mapping).
With a focus on simplicity and efficiency, Django PFX enables developers to rapidly
create robust web service APIs for web applications and simplifies the testing process.From version 1.3 PFX is only compatible with Django 4.2 LTS,
please use version 1.2 for older Django versions.Key Features:Predefined CRUD API (but customizable)InternationalizationAuthentication & AuthorizationJSON-only RESTful APIFlexibilityTests & Profiling ToolsAutomatic Open API DocumentationLinksSourceIssue trackerDocumentation
Package: django-pg8000
Django pg8000ADjangodatabase backend for thepg8000driver for PostgreSQL.Installation And UsageInstall with:pip install django_pg8000Set the DjangoDATABASESto something like:DATABASES = {
    "default": {
        "ENGINE": "django_pg8000",
        "HOST": "localhost",
        "PORT": 5432,
        "NAME": "django",
        "USER": "postgres",
        "OPTIONS": {},
    },
}ContributingAt the moment Django pg8000 doesn't pass all of the tests, so if you'd like to contribute, please
send a Pull Request that fixes a particular test.Testinggit clone https://github.com/django/django.gitcd testspython -m pip install -e ..python -m pip install -r requirements/py3.txt./runtests.py databasesThis will run the standard tests against the SQLite backend.Create a file atdjango/django/conf/test_pg8000.py:DATABASES = {
    "default": {
        "ENGINE": "django_pg8000",
        "HOST": "localhost",
        "PORT": 5432,
        "NAME": "django",
        "USER": "postgres",
        "OPTIONS": {},
    },
    "other": {
        "ENGINE": "django_pg8000",
        "HOST": "localhost",
        "PORT": 5432,
        "NAME": "django_other",
        "USER": "postgres",
        "OPTIONS": {},
    },
}

SECRET_KEY = "django_tests_secret_key"

# Use a fast hasher to speed up tests.
PASSWORD_HASHERS = [
    "django.contrib.auth.hashers.MD5PasswordHasher",
]

DEFAULT_AUTO_FIELD = "django.db.models.AutoField"

USE_TZ = FalseThen run./runtests.py --failfast --parallel=1 --exclude-tag=psycopg_specific --settings=django.conf.test_pg8000Some tests in the Django suite are specific to the pyscopg driver, so these can be marked with thepsycopg_specifictag.If tests fail then you may need to drop the databases that are left hanging around by doing something
like:psql --username=postgres -c "DROP DATABASE IF EXISTS test_django;" -c "DROP DATABASE IF EXISTS test_django_other;"Doing A Release Of Django pg8000git tag -a x.y.z -m "version x.y.z"rm -r distpython -m buildtwine upload dist/*Release NotesVersion 0.0.5Now requires pg8000 1.30.4 or higherVersion 0.0.4Various bug fixes, so a few more tests are passed.Version 0.0.3Rather than using the vendor 'postgresql', use 'postgresql_pg8000'. Otherwise Django assumes
that psycopg is installed.Version 0.0.2Add GitHub Actions testsVersion 0.0.1Initial release.
Package: django-pgallery
Photo gallery app for Django using PostgreSQL-specific goodies.OverviewThis is yet another Django app for creating and managing photos and photo
galleries, but with a PostgreSQL twist. It was made to show off some of the
advanced PostgreSQL features, therefore it is deliberately not portable
to other RDBMS-es.Featuresimage tagging with array data typestoring EXIF data in HStore fieldsResourcesIssue trackerAuthorZbigniew Siciarz (zbigniew at siciarz dot net)LicenseThis work is released under the MIT license. A copy of the license is provided
in the LICENSE file.
Package: django-pg-badges
Badges are earned by users for meeting someconditionsdefined
in the badge.json fileA Badge object (database model) is then created linking a user to a badge.conditionsCondition is a sql check to be made for awarding a badge.You have access to the variable NEW if you set thetrigger_contitionto “update” or “insert”. This is the database object after update or insert.You have access to the variable OLD if you set thetrigger_contitionto “update” or “delete”. This is the database object after update or delete.triggersWe want the badges to be given as soon as a condition is meet. Even if
the event come from an event outside the Django application.We do not want to relly on celery to periodicaly check for badgesToo often : this is a performance bootleneckToo late : annoying for usersThe check for each badge is checked when “something” change.To create the database triggers that will be responsible for badge earning run:>>> python manage.py create_badge_triggersWhen you changebadge.json(adding, updating or deleting badges) run this commande to reflect those changes in the database.badge.json example`[{"name":"Pionner", "code": "pionner", "condition": "age(NEW.date_joined) > interval '1year'","trigger_condition": "update", "trigger_table": "auth_user", "user_field": "id" }, {"name": "Collector", "code": "collector" "condition": "count(id) >= 5 from dummy_sketch where user_id = NEW.user_id", "trigger_condition": "insert", "trigger_table": "dummy_sketch", "user_field": "user_id" }, {"name": "Star", "code": "star", "condition": "hit_views > 1000 ", "trigger_condition": "update", "trigger_table": "dummy_sketch", "user_field": "user_id" }] `nameis the name of the badge as it will be displayed in the front or the API.codeis th unique code name of the badgeconditionis the query that will be issued to check if the badge
should be earnedtrigger_contitiontell when the check must be made. One of insert,
update or deleteINSTALLseeINSTALLfile for instructions.
Package: django-pgbulk
django-pgbulkdjango-pgbulkprovides functions for doing native Postgres bulk upserts (i.e.UPDATE ON CONFLICT) and bulk updates.Bulk upserts can distinguish between updated and created rows and optionally ignore redundant updates.Bulk updates are true bulk updates, unlike Django'sbulk_updatewhich can still suffer fromO(N)queries and can create poor locking scenarios.Quick StartDo a bulk upsert on a model:import pgbulk

pgbulk.upsert(
    MyModel,
    [
        MyModel(int_field=1, some_attr="some_val1"),
        MyModel(int_field=2, some_attr="some_val2"),
    ],
    # These are the fields that identify the uniqueness constraint.
    ["int_field"],
    # These are the fields that will be updated if the row already
    # exists. If not provided, all fields will be updated
    ["some_attr"]
)Do a bulk update on a model:import pgbulk

pgbulk.update(
    MyModel,
    [
        MyModel(id=1, some_attr='some_val1'),
        MyModel(id=2, some_attr='some_val2')
    ],
    # These are the fields that will be updated. If not provided,
    # all fields will be updated
    ['some_attr']
)View the django-pgbulk docsfor more information.Compatibilitydjango-pgbulkis compatible with Python 3.8 - 3.12, Django 3.2 - 5.0, Psycopg 2 - 3, and Postgres 12 - 16.DocumentationView the django-pgbulk docs hereInstallationInstalldjango-pgbulkwith:pip3 install django-pgbulkAfter this, addpgbulkto theINSTALLED_APPSsetting of your Django project.Contributing GuideFor information on setting up django-pgbulk for development and contributing changes, viewCONTRIBUTING.md.Primary AuthorsWes Kendall
Package: django-pgcli
django-pgcliReplaces your existingpsqlcli for Postgres withpgcliwhich provides enhancements such as auto-completion and syntax highlighting. Visit thepgcli websiteto learn more about thepgcliclient.InstallationTo install the package:`pip install django-pgcli`Adddjango_pgclito yourINSTALLED_APPSsetting in your settings.py file.INSTALLED_APPS = [
    ...,
    'django_pgcli',

]UsageTo use thepgclicommand with your project, call thedbshellcommand../manage.py dbshellHistory1.0.1 (2020-06-21)Rebuild wheel1.0.0 (2020-06-20)Upgrades to support Django LTS and aboveLimits support to Python30.0.2 (2015-04-26)Fixed typo in README.rst0.0.1 (2015-04-25)Initial release.
Package: django-pgclone
django-pgclonedjango-pgclonemakes it easy to dump and restore Postgres databases.
Here are some key features:Streaming dumps and restores to configurable storage backends like S3. Instances with limited memory aren't a problem for large databases.A restoration process that works behind the scenes, swapping in the restored database when finished.Configurable hooks into the dump and restore process, for example, migrating a restored database before it is swapped.Reversible restores, making it possible to quickly revert to the initial restore or the previous database.Re-usable configurations for instrumenting different types of dumps and restores.QuickstartTo dump a database, do:python manage.py pgclone dumpTo list database dump keys, do:python manage.py pgclone lsTo restore a datase, do:python manage.py pgclone restore <dump_key>Database dumps are relative to the storage location, which defaults to the local file system. Dump keys are in the format of<instance>/<database>/<config>/<timestamp>.dump.When listing, use an optional prefix. Restoring supports the same interface, using the latest key that matches the prefix.DocumentationView the django-pgclone docs hereto learn more about:The basics and an overview of how it works.The core command docs.Configuring an S3 storage backend.Running management command hooks during dumping or restoring.Creating restores that can be quickly reverted.Re-using command parameters for different flows.All settings.Additional details on using AWS RDS databases.Compatibilitydjango-pgcloneis compatible with Python 3.8 - 3.12, Django 3.2 - 5.0, Psycopg 2 - 3, and Postgres 12 - 16.InstallationInstalldjango-pgclonewith:pip3 install django-pgcloneAfter this, addpgcloneto theINSTALLED_APPSsetting of your Django project.NoteInstall the AWS CLI to enable the S3 storage backend. Usepip install awsclior follow theinstallation guide here.Contributing GuideFor information on setting updjango-pgclonefor development and contributing changes, viewCONTRIBUTING.md.Primary Authors@wesleykendall (Wes Kendall)@ethanpobrien (Ethan O'Brien)
Package: django-pg-colorfield
Django Postgresql ColorFieldInspired byUtsob Roy(Codesign)[https://gitlab.com/codesigntheory/django-postgresql-rgb-colorfield]RequirementsPython 3.XPostgresql database in django.Installationpip install django-pg-colorfieldQuick startAdd colorfield to your INSTALLED_APPS setting like this:INSTALLED_APPS=[...'colorfield',]Import and Use ColorField:To get search features you have to addColorManagerwith your model.fromdjango.dbimportmodelsfromcolorfield_lib.colorfieldimportfieldsclassColorManager(fields.ColorManager,models.Manager):# You can put your queryset staffpassclassColorModel(models.Model):color=fields.ColorField(null=True,blank=True)objects=ColorManager()Filtering field.field="color"filed that you want to search.You can also pass ascolor="[1, 100, 200]"rocolor="#0164C8".radius=10is a margin you consider to search.queryset=ColorModel.objects.by_radius(...field="color",color=[1,100,200],radius=10,)
Package: django-pgconnection
django-pgconnectionprovides primitives for overriding Postgres
connection and cursor objects, making it possible to do the following:Hook into SQL generation. For example, it is not possible to log
every time a SQL statement is executed in Django or annotate SQL
with comments so that additional metadata is logged when executing
queries. Thepgconnection.pre_execute_hookcontext manager allows
one to hook into SQL before it is executed.Route database traffic to a different database. Although Django provides
the ability to construct custom database routers, routing to a different
database has to be instrumented throughout code and can be tedious
and error prone. Thepgconnection.routecontext manager can route
any database operations to a different database, even if it’s an external
management command that has not been instrumented to use a different
database.Thedocumentationhas
examples of how to usedjango-pgconnection.DocumentationView the django-pgconnection docs here.InstallationInstall django-pgconnection with:pip3 install django-pgconnectionAfter this, addpgconnectionto theINSTALLED_APPSsetting of your Django project.In order to use connection routing and hooks, one must configure
theDATABASESsetting insettings.pylike so:DATABASES = pgconnection.configure({
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'mydatabase',
    }
})Contributing GuideFor information on setting up django-pgconnection for development and
contributing changes, viewCONTRIBUTING.rst.Primary Authors@wesleykendall (Wes Kendall)