Saravanan666/pypi-org huggingface dataset:
Package: django-objectdump
InstallationInstallation is easy usingpip.$pipinstalldjango-objectdumpAdd toINSTALLED_APPSOptionally add configuration information (OBJECTDUMP_SETTINGS)SettingsOBJECTDUMP_SETTINGS={'MODEL_SETTINGS':{'app.model':{'ignore':False,'fk_fields':True,# or False, or ['whitelist', 'of', 'fks']'m2m_fields':True,# or False, or ['whitelist', 'of', 'm2m fields']'addl_relations':[]# callable or 'othermodel_set.all' strings}}}ignoreIfTrue, always ignore this model. Acts as if you used--excludewith this model.fk_fieldsIfFalse, do not include related objects through foreign keys. Otherwise, a white-list of foreign keys to include related objects.m2m_keysIfFalse, do not include related objects through many-to-many fields. Otherwise, a white-list of many-to-many field names to include related objects.addl_relationsA list of callables, which get passed an object, or strings in Django template syntax ('author_set.all.0'becomes'object.author_set.all.0'and evaluates toobject.author_set.all()[0])Options--formatDefault:jsonSpecifies the output serialization format for fixtures. Options depend onSERIALIZATION_MODULESsettings.xmlandjsonandyamlare built-in.--indentDefault:NoneSpecifies the indent level to use. The default will not do any pretty-printing or indenting of content.--databaseDefault:DEFAULT_DB_ALIASNominates a specific database to dump fixtures from. Defaults to the “default” database.-e,--excludeDefault:[]An appname or appname.ModelName to exclude (use multiple--excludeto exclude multiple apps/models).-n,--naturalDefault:FalseUse natural keys if they are available.--depthDefault:NoneMax depth related objects to get. The initial object specified is considered level 0. The default will get all objects.--limitDefault:NoneMax number of related objects to get. Default gets all related objects.-i,--includeDefault:allAn appname or appname.ModelName to whitelist related objects included in the export (use multiple--includeto include multiple apps/models).--idtypeDefault:'int'The natural type of the id(s) specified. Options are:int,unicode,long--debugDefault:FalseOutput debug information. Shows what related objects each object generates. Use with--verbosity2to also see which fields are the link.
Package: django-objectdumpdata
Creates django fixtures using a unique object and its related objectsDocumentationThe full documentation is athttps://django-objectdumpdata.readthedocs.org.QuickstartInstall django-objectdumpdata:pip install django-objectdumpdataThen use it in a project:import django_objectdumpdataFeaturesTODOCookiecutter Tools Used in Making This Packagecookiecuttercookiecutter-djangopackageHistory0.1.0 (2015-09-22)First release on PyPI.
Package: django-object-faq
A reusable Django app that allows to attach Q&As to any Django model instance.Currently the app provides the models for adding translated questions and
answers as well as a template tag to render them from a default template, you
can of course override and customize according to your needs.Future updates might include forms, that allow users to send their own
questions, but it is currently not implemented. Contributions are welcome =)InstallationTo get the latest stable release from PyPipipinstalldjango-object-faqTo get the latest commit from GitHubpipinstall-egit+git://github.com/bitmazk/django-object-faq.git#egg=object_faqAddobject_faqto yourINSTALLED_APPSINSTALLED_APPS=(...,'object_faq',)Before your tags/filters are available in your templates, load them by using{% load object_faq_tags %}Don’t forget to migrate your database./manage.pymigrateobject_faqUsageIn your django admin, you can create theEntryobjects with questions and
answers to be rendered on the page.positionis the default ordering of the
queryset.Additionally you can setup aGlobalObjectDescriptionobject per model
instance. This will render a general title and description, you might want to
use as introductory text for the object’s FAQ or just as general object
description.Then you only need to add the template tag for the object in the context.
.. code-block:: html{% load object_faq_tags %}{% render_faq_for_object myobject %}This will automatically render the tempalte located atobject_faq/partials/object_faq.html.ContributeIf you want to contribute to this project, please perform the following steps# Fork this repository
# Clone your forkmkvirtualenv-ppython2.7django-object-faqmakedevelopgitco-bfeature_branchmaster# Implement your feature and testsgitadd.&&gitcommitgitpush-uoriginfeature_branch# Send us a pull request for your feature branch
Package: django-objectid
Django-objectidDjango-objectid用于Django框架在分布式环境中高效生成不重复ID值。依赖django >= 2.2.0安装pip安装pipinstalldjango-objectid源码安装pythonsetup.pyinstall使用Django-objectid包括两个类，ObjectID，ObjectidModel。class objectid.ObjectID(id=None)生成、解析objectid。
参数id是一个长度为24的字符，如果是None则生成新的ObjectID实例，如果提供一个有效ID则解析这个ID为ObjectID实例。ObjectID实例有如下属性：timestamp，ID中的时间戳，也就是ID创建的时间。host，ID中的主机名，是实际主机名经过哈希处理后的值。pid，进程ID，可能与实际值不一致。count，同一进程一秒内生成的ID序号。fromobjectidimportObjectID,create_objectid# 创建ID对象id=ObjectID()# 获得id字符串idstr=str(id)# 直接创建id字符串idstr=create_objectid()# 解析id字符串id=ObjectID('5fb1ee9af1d79721f0000015')class objectid.ObjectidModel()ObjectidModel是一个抽象类，不能单独使用，作为定义django模型类的基类。实例对象有如下属性和方法：get_id_datetime()，返回id中的时间戳。
Package: django-object-lock
Django Object LockOops! I think I've edited the wrong object.We don't need to edit this any longer. I wish I could prevent this object from being edited anymore...Django Object Lock(django-object-lock) adds a "locked" status to your models to prevent their unintentional
modification or deletion from your Django admin site, your API or any view. You can "lock" an instance to protect it
and then "unlock" it to allow further modifications or deletions.Check out thedocumentationfor more information.FeaturesA lock icon will appear in the changelist for each locked instance.The detail page for a locked object will be read-only.This "locked" status may be set manually (adding a field for your users to lock or unlock the object) or
automatically (locking objects depending on a condition).For example, you can have a parent model that can be locked setting manually a Boolean field and a child model
that will be automatically locked or unlocked whenever its parent is.This way, you can lock and unlock entire hierarchies of model instances.Supportdjango-object-lockis tested with the following versions of Python and Django:Python >= 3.8Django 4 or 5Django REST Framework >= 3.14 (to enforce object locking from your API generic views and viewsets)Django is the only required dependency.Development instructionsYou can find a demo project and a test suite in thedemodirectory.The demo project contains three lockable models:anArticlemodel,a childArticleSectionmodel, andaNotLockedModelthat is registered in the admin as a lockable model, but it does not have locking logic.You will need to install development dependencies in your Python environment:pipinstall-rrequirements-dev.txtThen, run the demo application:cddemo&&pythonmanage.pyrunserverOr run tests with Tox:# Test for Python 3.12, Django 5.0 and Django REST Framework 3.14.tox-epy3.12-django5.0-drf3.14# Generate a coverage report.tox-ecoverage# Check PEP8 compliance.tox-eflake8
Package: django-object-log
This app provides the ability to log user actions on model instances. Action
types can be defined by app developers, and can reference multiple objects.
Each action type defines it’s own template used for rendering output of the
message. It allows verbose messages specific to the action that occurred.Object Log includes shortcuts both for adding entries and building views to
display them.InstallationThere are several ways to install Object Log.Object Log ships a standard distutils setup.py. A classic invocation
to install from setup.py might be:$ python setup.py installYou may need to add sudo in order to install to the system Python.$ sudo python setup.py installWe also have Object Log on PyPI, so it can be installed using pip.
(easy_install also works, but we do not recommend easy_install. Just use pip.)$ pip install django-object-logIf you are installing Object Log directly into a Django app, and want
to distribute Object Log with your app, simply copy the
object_log folder into your Django project.Configuring Your Django ProjectAdd “object_log” to INSTALLED_APPSRun ./manage.py syncdbAdd object_log.urls to urls if you wish to add views for displaying logsUsing Object LogFirst, register some action types.  This can be done at any time but should
ideally be done once in models.py.  LogActions require both a key and a
template used to render that Action type.>>> from object_log.models import LogAction
>>> LogAction.objects.register('MY_ACTION', 'path/to/my/template.html')Now, that LogAction type can be used whenever that action occurs>>> from object_log.models import LogItem
>>> log = LogItem.objects.log_action
>>> log('MY_ACTION', user, some_object)
>>> log('EDIT', user, some_object)
>>> log('DELETE', user, some_object)Arbitrary data can also be included with each log entry by including a
dict  It is available in the LogAction template as {{data}}.  This is
useful for caching information to reduce related queries when rendering
logs>>> log('MY_ACTION', user, {'my_obj':str(obj1})The data dict can be automatically populated from objects using a cache
function registered with the LogAction.  The cache function recieves the user,
objects, and any data passed to log_Action().  It should return a dict.  This
data overwrites manual data, you must merge it manually if you want to use both.>>> def cache(user, obj1, obj2, obj3, data):
>>>    return dict(obj_str=str(obj1))
>>>
>>> LogAction.objects.register('MY_ACTION', 'path/to/my/template.html', cache)log_action can then be used as normal.>>> log('MY_ACTION', user, some_object)See the wiki for more details:http://code.osuosl.org/projects/django-object-log/wikiAuthorsObject Log was implemented at the Oregon State University Open Source Lab
(OSUOSL).  The primary author was Peter Krenesky.
Package: django-object-manager
django-object-managerSimple, declarative, repeatable object management for Django testsExamples:# Model registration - usuallu in app/tests.py
# from .models import ...
from .models import User, Film, FilmCategory
from django_object_manager import ObjManagerMixin, ObjectManager


ObjectManager.register(
    User,
    {
        'bob': {
            'name': 'Bob',
            'email': 'bob@domain.com',
        },
        'alice': {
            'name': 'Alice',
            'email': 'alice@example.com',
        },
    })
ObjectManager.register(
    FilmCategory,
    {
        'drama': {
            'name': 'Drama',
        },
        'crime': {
            'name': 'Crime',
        },
        'serious': {
            'name': 'Adult films',
        },
        'anime': {
            'name': 'Anime',
            'parent': 'serious',
        },
    })
ObjectManager.register(
    Film,
    {
        'memento': {
            'name': 'Memento',
            'year': 2000,
            'uploaded_by': 'bob',
            'categories': ['crime', 'drama']
        },
})

# Further usage in tests:
object_manager = ObjectManager() # or self.object_manager if inherited from 
# Single object creation - 'bob' is previously registered idenitifier
bob = object_manager.get_user('bob')

# Object creation with attribute owerwriting
user3 = object_manager.get_user('bob', email='other@domain.com')

# Fully custom object creation
user = object_manager.get_user(name='Jack',
                               email='test@test.org')

# All predefined objects of given model - returns id:object dictionary
user = object_manager.get_users()


# Object with dependencies - dependencies are referenced by
# - their registered indentifiers
# - by passing already created object

memento = object_manager.get_film('memento') # Will create two categories and one user
Package: django-objectpermissions
Django Object Permissions is a way to add a custom set of user-object or group-object permissions. It does not replace Django’s built-in permissions. Instead it augments them by adding additional ways to manage access to specific objects.You can add object permissions to existing apps (e.g. Flat Pages) without modifying the app’s code, or build it into your own application.It uses an efficient method of storing permissions; it requires only one row per user-object combination, regardless of the number of permissions granted.Our initial goals were pretty simple (in thought, not necessarily in deed):Have an easy way to set read/write/owner permissions on an object or rowEasy to discover if a given user has a level of permissionCustomizable permissions by modelAdmin viewing/editing integrationThis is a proof-of-concept right now and we are looking for feedback for tweaks in implementation or new ideas to implement.
Package: django-object-permissions
This is an implementation of Object Permissions, a.k.a. row level permissions.
Object Permissions allow you to assign a permission to an instance of any
Model in your django project.  This app provides a authentication backend
that works with Django >= 1.2.This specific implementation includes the ability to assign permissions to
Users and UserGroups. Later versions may include the ability to create
PermissionGroups and ObjectPermissionGroups.InstallationThere are several ways to install Object Permissions.Object Permissions ships a standard distutils setup.py. A classic invocation
to install from setup.py might be:$ python setup.py installYou may need to add sudo in order to install to the system Python.$ sudo python setup.py installWe also have Object Permissions on PyPI, so it can be installed using pip.
(easy_install also works, but we do not recommend easy_install. Just use pip.)$ pip install django-object-permissionsIf you are installing Object Permissions directly into a Django app, and want
to distribute Object Permissions with your app, simply copy the
object_permissions folder into your Django project.Configuring Your Django ProjectAdd “object_permissions” to INSTALLED_APPSAdd “object_permissions.backend.ObjectPermBackend” to AUTHENTICATION_BACKENDS.Run ./manage.py syncdbif South is enabled for your project you will need to create tables using migrate3b) Run ./manage.py migrateUsing Object PermissionsFirst, register some permissions onto a Model in your models.py. This can only
be done once per model; see registration.py for more information.>>> from object_permissions import register
>>> register(['permission'], Model)Now, that permission can be granted, revoked, or checked for any instance of
that Model.>>> user.grant('permission', object)
>>> user.revoke('permission', object)
>>> user.has_perm('permission', object)
>>> group.grant('permission', object)
>>> group.revoke('permission', object)AuthorsObject Permissions was originally implemented by Peter Krenesky at the Oregon
State University Open Source Lab (OSUOSL). This release is maintained by
Ken Lett.
Package: django-objects-count
Installation$pipinstalldjango-objects-countHow it worksadmin interfacemiddleware (optional, admin urls only) - dynamic modelsverbose_name_pluralwith objects countsettings.pyINSTALLED_APPS+=['django_objects_count']MIDDLEWARE+=['django_objects_count.middleware.ObjectsCountMiddleware']# optionalmigrate$pythonmanage.pymigrate
Package: django-objectsyncer
Django Object SyncerDjango application allowing a server instance to track modifications of instance of certain models and push them to
remote clients.In summary, how does it work ?Two abstract classes exist: VersioningBaseModel and TrackingAndVersioningBaseModel.The versioning base model have the following fields :a UUID (version 4), unique for this modela version, starting at 1a creation datetimea last edition datetimean inactive flagThe tracking and versioning base model have the following field added to the fields of VersioningBaseModel.an active state by applicationsIt is then possible to create a monitored Model :class VersioningFakeClass(TrackingAndVersioningBaseModel):
    """
    A code
    """
    code = models.CharField(max_length=20)

    """
    A name 
    """
    name = models.CharField(max_length=250)

    """
    Tracker
    """
    tracker = FieldTracker()An Application is a remote application that must be updated with each change. ach application contains a remote Rest API
endpoint  and an Authorization Key.For each change, a JobChange is created per application. A cron job will then consume JobChanges by making a POST
request on the endpoint API of each application.At the customer level, they dynamically process the fields to keep only those present in their model (each customer
does not need all the fields).
Package: django-object-toolbar-admin
django-object-tools-adminAdd toolbar in every item line in django's changelist view, and on top of django's changeform view.Installpip install django-object-toolbar-adminUsagepro/settings.pyINSTALLED_APPS = [
    ...
    'django_static_fontawesome',
    'django_object_toolbar_admin',
    ...
]Add django_static_fontawesome and django_object_toolbar_admin applications in INSTALLED_APPS.app/admin.pyfrom django.contrib import admin
from django_object_toolbar_admin.admin import DjangoObjectToolbarAdmin
from .models import Category

class CategoryAdmin(DjangoObjectToolbarAdmin, admin.ModelAdmin):
    list_display = ["name", "django_object_toolbar", "my_toolbar"]

    django_object_toolbar_changeform_buttons = [
        "print",
        "export",
        "bye",
    ]
    # define default toolbar
    django_object_toolbar_buttons = [
        "print",
        "export",
        'bye',
    ]

    def print(self, obj):
        return "/print"
    print.icon = "fas fa-print"
    print.title = "Print"
    print.help_text = "Print the object information..."
    
    def export(self, obj):
        return "/export"
    export.icon = "fas fa-save"
    export.title = "Export"

    # define my toolbar
    def my_toolbar(self, obj):
        return self.get_django_object_toolbar("my_toolbar_buttons", obj)
    my_toolbar.short_description = "My Toolbar"

    my_toolbar_buttons = [
        "delete",
        "say_hi",
    ]

    def delete(self, obj):
        return "/delete"
    delete.icon = "fas fa-trash"
    delete.title = "Delete"

    def say_hi(self, obj):
        return "javascript:alert('hi {}');".format(obj.pk)
    say_hi.icon = "fas fa-music"
    say_hi.title = "Say Hi!"

admin.site.register(Category, CategoryAdmin)Buttons indjango_object_toolbar_changeform_buttonswill display on top of changeform view.Buttons indjango_object_toolbar_buttonsormy_toolbar_buttonswill display in every line in changelist view. You need to putdjango_object_toolbarormy_toolbarinlist_display.A button can be a method of admin or a method of model instance.A button method returns the link of the button.A button method tasks extra configs:button.titlebutton.iconbutton.help_textbutton.targetbutton.klassReleasesv0.1.0First release.v0.1.1Fix Button.from_dict calling problem.Add i18n.Add app_requires.v0.1.2Doc update.
Package: django-object-utils
django-object-utilsThis small library provides helpers for updating Django model objects without race conditions.Installationpip install django-object-utilsUsagefromdjango_object_utilsimportreload_object,update_object,lock_objectuser=User.objects.get(pk=1)# Reload object in-place with the latest version from the databasereload_object(user)# Run SQL UPDATE for certain fields only and update the Python objectupdate_object(user,username='john',email='john@gmail.com')# Run SQL UPDATE and then reload the object from the databaseupdate_object(user,balance=F('balance')+payment,reload=True)ifrequest.method=='POST':withtransaction.atomic():# Enter a critical section and ensure that the object is the latest version.# Use the corresponding database row as the synchronization monitor.lock_object(user)form=UserForm(data=request.POST)form.save()
Package: django-obm
RationaleThere are a lot of projects that need a cryptocurrency payment system under
the hood for transactions sending/receiving, unique addresses creation, fee
estimating and other blockchain interactions. Each of them have to implement
their own service for that propose due to lack of opensource product, that
could satisfy their needs. This project aims to provide such functionality and
facilitate the implementation of such a microservice.ResourcesDocumentation:https://django-obm.readthedocs.ioInstallationSeeInstallationfor complete instructions.pipinstalldjango-obmRequirementsPython 3.8 or higher.bitcoin-corenodeFeaturesBTC (bitcoin-core) supportsending/receiving transactions and confirmationunique addresses creationfee estimatingREST API for actions aboveFuture featuressupport of: ETH, ETC, DASH, BCHABC, BCHSV, LTC, ZEC, XEM, XRP, etc.django_obm.walletapp witch help in implementation of multi
cryptocurrency walletIs django-obm production ready?The project is now under active development. Use at your own risk.ExampleYou can find the example project in this repoexample folder.ContributingSeeCONTRIBUTING.mdfor instructions.Support the developerSponsorsSpecial thanks forSwapzillaproject that
paid me part of the development.You can also become the sponsor and get priority development of the features
you require. Justcontact me.Buy me a beerBTC179B1vJ8LvAQ2r9ABNhp6kDE2yQZfm1Ng3
Package: django-observable-models
Django Observable ModelsDjango Observable Models allows you to subscribe to model operations using rxpy Observables. This is particularly useful for implementing things like GraphQL subscriptions.Installation$pipinstalldjango-observable-modelsUsage# yourapp/models.pyfromobservable_models.modelsimportObservableModelclassYourModel(ObservableModel):pass# Subscribe to model creationYourModel.model_events.pipe(filter(lamdaevent:event['operation']==YourModel.CREATED))# Subscribe to model updatesYourModel.model_events.pipe(filter(lamdaevent:event['operation']==YourModel.UPDATED))# Subscribe to model deletionYourModel.model_events.pipe(filter(lamdaevent:event['operation']==YourModel.DELETED))
Package: django-observer
Watch modification of any type of field in Django’s model and call registered callback functionThis observer can watchAny value type of field (CharField, IntegerField …)Any Model type of field (ForeignKey, OneToOneField, GenericForeignKey)Any RelatedManager type of field (field automatically created viarelated_nameof ForeignKey)Any ManyRelatedManager type of field (ManyToManyField)Any GenericRelatedObjectManager type of field (GenericRelation)Any Model instanceInstallThis library is on PyPI so you can install it with:pip install django-observeror from github:pip install git+https://github.com/lambdalisue/django-observer.gitUsage>>> from django.db import models
>>> from observer import watch
>>>
>>> class Entry(models.Model):
...     status = models.CharFiled('status', max_length=10)
...     body = models.CharField('title', max_length=100)
...
...     def save(self, *args, **kwargs):
...         super(Entry, self).save(*args, **kwargs)
...
...         # Watch callback, this is automatically called if `status` is **changed**
...         def watch_callback(sender, obj, attr):
...             # sender is a watcher instance
...             # obj is a instance of target
...             # attr is a name of target field
...             if obj.status == 'draft':
...                 obj.title = "draft - %s" % obj.body
...             else:
...                 obj.title = "publish - %s" % obj.body
...         # Start watching
...         self._watcher = watch(self, 'status', watch_callback)Seeobserver_test/src/miniblog/blog/tests/test_observer.pyfor more detail.SettingsOBSERVER_DEFAULT_WATCHERA class of watcher. Default is ‘observer.watcher.complex.ComplexWatcher’