Saravanan666/pypi-org huggingface dataset:
Package: django-generic-filters
django-generic-filtersis a toolkit to filter results of Django’sListView, using forms.Main use cases are obviously search forms and filtered lists.As a developer, given you have aListView, in order to let the user
filter the results:use a form to easily render the filters as HTML;the user typically sends the filters via GET;validate the user’s input using a Django form;filter the Django view’s queryset using form’s cleaned data.Exampleviews.pyfromdjango_genericfilters.viewsimportFilteredListViewclassUserListView(FilteredListView):# ListView options. FilteredListView inherits from ListView.model=Usertemplate_name='user/user_list.html'paginate_by=10context_object_name='users'# FormMixin options. FilteredListView inherits from FormMixin.form_class=UserListForm# FilteredListView options.search_fields=['first_name','last_name','username','email']filter_fields=['is_active','is_staff','is_superuser']default_order='last_name'defform_valid(self,form):"""Return the queryset when form has been submitted."""queryset=super(UserListView,self).form_valid(form)# Handle specific fields of the custom ListForm# Others are automatically handled by FilteredListView.ifform.cleaned_data['is_active']=='yes':queryset=queryset.filter(is_active=True)elifform.cleaned_data['is_active']=='no':queryset=queryset.filter(is_active=False)ifform.cleaned_data['is_staff']=='yes':queryset=queryset.filter(is_staff=True)elifform.cleaned_data['is_staff']=='no':queryset=queryset.filter(is_staff=False)ifform.cleaned_data['is_superuser']=='yes':queryset=queryset.filter(is_superuser=True)elifform.cleaned_data['is_superuser']=='no':queryset=queryset.filter(is_superuser=False)returnquerysetforms.pyfromdjangoimportformsfromdjango.utils.translationimportgettext_lazyas_fromdjango_genericfiltersimportformsasgfclassUserListForm(gf.QueryFormMixin,gf.OrderFormMixin,gf.FilteredForm):is_active=gf.ChoiceField(label=_('Status'),choices=(('yes',_('Active')),('no',_('Unactive'))))is_staff=gf.ChoiceField(label=_('Staff'))is_superuser=gf.ChoiceField(label=_('Superuser'))defget_order_by_choices(self):return[('date_joined',_(u'date joined')),('last_login',_(u'last login')),('last_name',_(u'Name'))]FormsSeveral form mixins are provided to cover frequent use cases:OrderFormMixinwith order_by and order_reverse fields.QueryFormMixinfor little full-text search using icontains.See “mixin” documentation for details.RessourcesDocumentation:https://django-generic-filters.readthedocs.ioPyPI page:http://pypi.python.org/pypi/django-generic-filtersCode repository:https://github.com/peopledoc/django-generic-filtersBugtracker:https://github.com/peopledoc/django-generic-filters/issues
Package: django-generic-follow
django-generic-follow is a system to allow users to follow any model in
a Django project.Installation / SetupBasicsFirst, install the package with pippipinstalldjango-generic-followThen addgeneric_followto yourINSTALLED_APPSINSTALLED_APPS=(...,'generic_follow',)User ModelIf you are using theauth.Useruser model, the user instance methods
will be set up for you. If you are using a custom User model, you will
need to apply theUserFollowMixinfromdjango.contrib.auth.modelsimportAbstractUserfromgeneric_follow.model_mixinsimportUserFollowMixinclassMyCustomUser(UserFollowMixin,AbstractUser):...Target ModelsTo add the convenience methods to models that will be followed apply theTargetFollowMixinfromdjango.dbimportmodelsfromgeneric_follow.model_mixinsimportTargetFollowMixinclassBand(TargetFollowMixin,models.Model):name=models.CharField(max_length=255)UsageFollow/UnfollowTo make a user follow a model instance use theuser.followmethoduser=User.objects.first()band=Band.objects.get(name='Foals')user.follow(band)To make a user unfollow a model instance simply calluser.unfollowuser.unfollow(band)Checking if a user currently follows a model instance involves callinguser.is_followinguser.is_following(band)# true/falseRetrieval MethodsTo see all model instances that a user is following call theuser.get_follow_setmethod.user.get_follow_set()# [<Band: foals>]Optionally, themodelkwarg can be provided to only return followed
instances of that model typeuser.get_follow_set(Photographer)# []On the follow target,model.get_follower_setcan be called to
retrieve all followersband.get_follower_set()Batch OperationsTo make a list of users follow a given model instance call thecreate_batchmanager methoduser2=...Follow.objects.create_batch(users=[user,user2],target=band)To perform the inverse, call thedelete_batchmanager methodFollow.objects.delete_batch(users=[user,user2],target=band)To make some users follow a model instance, and others unfollow the same
model instance in the same command, useupdate_batch. Theusers_followkwarg accepts a 2-tuple of user instance, and a boolean
indicating if this user should be following the instance.Follow.objects.update_batch(target=band,users_follow=[(user,True),(user2,False)])# user will now be following foals, user2 will now not be following foalsSignalsBatch operations emit signals which can be used elsewhere in your
project.follow_bulk_create: Sent afterFollow.objects.create_batch()completesfollow_bulk_delete: Sent afterFollow.objects.delete_batch()completesThese signals sendusersandtargetas kwargs.Connecting to these signals is the same as any other Django signaldefbulk_create_callback(sender,**kwargs):...fromgeneric_follow.signalsimportfollow_bulk_createfollow_bulk_create.connect(bulk_create_callback,sender=Follow)ContributionsPull requests / issues welcome!
Package: django-genericforeignkey
ContentsGeneric Foreign KeyInformationDependenciesInstallationInstall in your base_site.html of django adminIn your settings.pyIn your ModelAdmin0.60.4Generic Foreign KeyInformationGeneric Foreign Key is a Django application that allows your Generic relations have a nice widget in the adminIt is distrubuted under the terms of the GNU Lesser General Public
License <http://www.gnu.org/licenses/lgpl.html>Dependencies<script src="/media/js/jquery-1.2.6.min.js"></script>InstallationInstall in your base_site.html of django admin<script src-"/media/js/jquery-1.2.6.min.js"></script>In your settings.pyAdd a setting EXCLUDE_CONTENT_TYPES, with the content types to exclude. This step is not necesary, but advisableEXCLUDE_CONTENT_TYPES = (('auth', 'group'), ('auth', 'messege'), ...)You can filter too, with this settingFILTER_CONTENT_TYPES = (('auth', 'group'), ('auth', 'messege'), ...)If you want to a UI more friendly to select a the contentSEARCH_MODELADMIN = TrueAnd in your change_list.html overwrite extrastyle block:{% block extrastyle %}
  {{ block.super }}
  <link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/changelists.css" />
  {% if cl.formset %}
      <link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />
      {% url admin:jsi18n as jsi18nurl %}
      <script type="text/javascript" src="{{ jsi18nurl|default:'../../jsi18n/' }}"></script>
  {% endif %}
  {{ media }}
  {% if not actions_on_top and not actions_on_bottom %}
      <style>
      #changelist table thead th:first-child {width: inherit}
      </style>
  {% endif %}
  {{ generic_fk_media }}
{% endblock %}In your ModelAdminExtend yout ModelAdmin with GenericAdminclass MyModelAdmin(GenericAdmin):
    ...0.60.4Spanish translations
Package: django-generic-helpers
The application provides some syntax sugar for working with Django’sgeneric relationsInstallationJust install the package from PyPI withinpippipinstalldjango-generic-helpers…orpipenvpipenvinstalldjango-generic-helpers…or evenpoetrypoetryadddjango-generic-helpersThat’s all. No need to add this intoINSTALLED_APPSof your project or something like that.UsageThat’s how did you work with generic relations before:# models.pyfromdjango.contrib.contenttypes.fieldsimportGenericForeignKeyfromdjango.contrib.contenttypes.modelsimportContentTypefromdjango.dbimportmodelsclassPost(models.Model):passclassImage(models.Model):content_type=models.ForeignKey(ContentType,on_delete=models.CASCADE)object_id=models.IntegerField()content_object=GenericForeignKey(ct_field='content_type',fk_field='object_id')# Example of filteringpost=Post.objects.get(pk=1)images=Image.objects.filter(content_type=ContentType.objects.get_for_object(post),object_id=post.id)Looks verbose a bit, yep? Let’s rewrite this withdjango-generic-helpers# models.pyfromdjango.dbimportmodelsfromgeneric_helpers.fieldsimportGenericRelationFieldclassPost(models.Model):passclassImage(models.Model):content_object=GenericRelationField()# Example of filteringpost=Post.objects.get(pk=1)images=Image.objects.filter(content_object=post)Personally, I found it much simpler and cleaner.Features the application provides:Creating an arbitrary number of generic relation fields, both required and optional;Providing custom names forcontent_typeandobject_idcolumnsYou can define a whitelist (or a black one) of models that could (not) be written into the fieldPlease, follow up the documentation for details.ContributingIf you found a bug, feel free to drop mean issue on the repo;Implemented a new feature could be useful?Create a PR!A few words if you plan to send a PR:Please, write tests!FollowPEP-0008codestyle recommendations.When pushing, please wait whileTravis CIwill finish his useful work and complete the build. And if the build fails, please fix the issues before PRAnd of course, don’t forget to add yourself into theauthors list;)LicenseThe license is MIT.
Package: django-genericimports
# django-genericimportsSTATUS: beta6Django application to import data regardless of data/field/thirdparty types or headers. This importer is focused on functionality, completeness, data cleanliness and reporting, not on speed itself.Check the documentation at:http://django-genericimports.rtfd.org/# How to install$ pip install django-genericimports# LicenseThis application is licensed in BSD 2-Clause license. This application was developed while at work on Havas Worldwide London, so part of the kudos goes to them as well.# AuthorsOscar Carballal Prego <oscar.carballal@gmail.com>Max Barry <max.barry@havasww.com>
Package: django-generic-m2m
relate anything to anything.  the image below is a screenshot of theexample appand shows a blog post that has been “related” to 2 “Place” models and a “City” model:check thedocumentationfor
more examples and an in-depth description of the app (or keep reading for
the 30 second version).what it doesthe purpose of this project is to allow you to create database-level
relationships between various objects using a consistent api.example appbundled with the source code is an example app which shows how generic-m2m
can be used to create “tags” between models.  it usesnathanborror’s basic appswithdjango-completion(shameless plug)
to allow users to “autocomplete” various relationships between models, so if I’m
a user and want to create a new blog post I can tag it with
relationships to objects representing a city, a place, a funny photo of a cat, etc.quick overviewsay you have a couple models:class Food(models.Model):
    name = models.CharField(max_length=255)

    related = RelatedObjectsDescriptor()

    def __unicode__(self):
        return self.name


class Beverage(models.Model):
    name = models.CharField(max_length=255)

    related = RelatedObjectsDescriptor()

    def __unicode__(self):
        return self.nameHere’s a sample interactive interpreter session to show the basic API:>>> pizza = Food.objects.create(name='pizza')
>>> pepperoni = Food.objects.create(name='pepperoni')
>>> beer = Beverage.objects.create(name='beer')
>>> soda = Beverage.objects.create(name='soda')

>>> pizza.related.connect(pepperoni)
<RelatedObject: pizza related to pepperoni ("")>

>>> pizza.related.connect(beer)
<RelatedObject: pizza related to beer ("")>

>>> pepperoni.related.related_to()
[<RelatedObject: pizza related to pepperoni ("")>]

>>> pizza.related.all()
[<RelatedObject: pizza related to beer ("")>, <RelatedObject: pizza related to pepperoni ("")>]

>>> pizza.related.all().generic_objects()
[<Beverage: beer>, <Food: pepperoni>]

>>> Food.related.all()
[<RelatedObject: pizza related to beer ("")>, <RelatedObject: pizza related to pepperoni ("")>]
Package: django-generic-notifications
A Django app that can handle multiple ways of showing different notification types. It’s all based on multiple input
types and output backends.NotificationsA notification could be anything:you have received a private message on a forumthere is a new comment on your blogsomeone liked your profile or articlea new post was created in a thread you followsomeone answered your pollyou have a new friend request or followerAs far as this project is concerned, a notification is nothing more but an (optional) subject, text body, and a list of
receivers.BackendsThere are multiple output backends. Some possible examples are:emailsms messageiPhone push notificationnotification centerAt this moment only two email backends are provided.Notification typesA notification type is the glue between a message (input) and one or more possible backends (output). For example, you
might want to send all account related messages to email only, but notifications about new private messages could go to
email, iPhone push messages, Django’s own messages app, you name it.Each notification type can specify its allowed backend(s), and each user can specify his preferred output backend(s).
Each notification will then figure out what backend to use based on this information.SettingsSome backends will need extra information from the user, for example a phone number or email address.Users can also select which notification types they’re interested in, and what possible backends they would like to
receive the message on.QueueMost notification backends can’t process in real time, instead adding them to a queue. At this moment, this is based on
a simple database model and a manage.py script which can be used from your cron.In the future celery tasks should be added too.InstallationSeeINSTALL.rstUsageSeeUSAGE.rstfor examples
Package: django-generic-ratings
This application provides rating functionality to a Django project.You can handle scores and number of votes for each content type
without adding additional fields to your models.Different vote types can be associated to a single content object, and you
can write rules and business logic in a customized rating handler describing
how a model instance can be voted.This app providesjQuerybased widgets, useful for increasing the voting
experience of users (e.g.: slider rating, star rating).The source code for this app is hosted onhttps://bitbucket.org/frankban/django-generic-ratings/srcDocumentationis avaliableonlineand in the docs directory of the project.
Package: django-genericrelationview
#Aboutdjango admin interface for GenericForeignKey fields#Install> pip install django-genericrelationviewor> easy_install django-genericrelationview##Usage###in settings.py> INSTALLED_APPS = ( … ,’genericrelationview’,)###in url.py
> urlpatterns =( …, url(r”^your_path/”, include(“genericrelationview.urls”)),)###in admin.py
for ModelAdmin class using GenericAdminMixin as mixin
Package: django-generic-search
Django Generic Search is a Django app to conduct generic search on your site’s pages. Visitors on your site can search for any
available pages on your side given they new or can guess accurately keywords or search queries related to thos pages.The app uses the page title and meta name and meta description html tags to generate search results so be sure to include
this tags in your html page templates.The application is currently not optimized for sites that result in large amounts of data upon crawling.For a better experience, this app can be used together withdjango-robotsand the django sitemaps framework.Quick startInstall the package usingpip.$pipinstalldjango-generic-searchAddgeneric-searchto yourINSTALLED_APPSsetting like thisINSTALLED_APPS=[...'generic-search',]Include thegeneric-searchURLconf in your project urls.py like thispath('search/',include('generic-search.urls')),Create a html form and point its action attribute to the above url as below<formmethod="GET"action="{% url 'search:general_search' %}"><inputtype="text"name="q"placeholder="Search..."><buttontype="submit"class="btn btn-outline-primary custom-inline-button">Go</button></form>include settings below in projectsettings.pyALLOWED_HOSTS=['localhost',]SPYDER_START_URLS={'gammaspider':['https://localhost:8000/']}When in production, update the settings above appropriately to reflect your production environment.Override the default template used to display the search index and search results page to reflect the theme of
your site by creating a templates directory in your project root directory. In the created templates directory,
create a directory with the namegeneric_searchand place index.html in it. You can copy the template provided in the
package to the path created above to get a full picture of the available blocks that can be overriden.Start the development server and visithttp://127.0.0.1:8000/On a new terminal, run the commands below.Runpython manage.py crawlsiteto generate data about available pages on your site.
Runpython manage.py cleancrawlresultsto prepare the data for indexing.
Runpython manage.py indexsiteto generate an index file for the data.Visithttp://127.0.0.1:8000/<url as apecified in your url conf>/?q=<search-query> to search.
Package: django-genetics
Alpha: DO NOT USE IN PRODUCTION
Django Genetics is a Django app that integrate data from  HGNC, OMIM and
web services from mutalyzer.nl and ensembl.org to provide an information
rich data entry for genes an mutation variantsQuick startAdd “genetics” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'genetics',
]Runpython manage.py migrateto create the models.Runimport_genemanagement command to import HGNC and OMIM data.Use in forms ….
Package: django-genie
# django-genie
Based on django-geniehttps://github.com/Minelytics/django-genieA python module which generate the django code. Useful for generating django-rest-framework code. Prints out the code in console for simple copy paste where its required. It uses templates for code generation which can be customized.Command usage:$ docker-compose -f local.yml run –rm django python manage.py code_generator <app_name> <template_name>
Package: django-genomix-workflows
Django App for storing Workflows and TrackingDocumentationThe full documentation is athttps://django-genomix-workflows.readthedocs.io.QuickstartInstall django-genomix-workflows:pip install django-genomix-workflowsAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'genomix_workflows',...)Add django-genomix-workflows’s URL patterns:fromgenomix_workflowsimporturlsasgenomix_workflows_urlsurlpatterns=[...url(r'^',include(genomix_workflows_urls,namespace='genomix_workflows')),...]FeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2018-01-12)First release on PyPI.0.2.0 (2018-06-27)Changed models completely.Add graph interpretations for workflows.Add signal to automatically create task instances after workflow instance initiation.Add signals to update related task status after task updates.Add methods for single workflow/task instances to get current status, graph, JSON graph, and other useful helpers.Add managers for combined workflow and task methods.Add single and combined graph diagram, current status, and topographical sort to Django Admin.Complete the switch to Django 2.0Update requirements and dependencies.0.2.1 (2018-07-02)Add raw id in Admin for workflow instance parent field0.2.2 (2018-07-03)Add raw id in Admin for Task instance0.2.3 (2018-07-06)Fix an issue with next and previous task instances0.2.4 (2018-07-08)Improve combined Next and Previous calculations0.2.5 (2018-07-09)Fix current state for a single workflow without running or pending tasks0.2.6 (2018-08-07)Add Skip action featureIncrease coverage0.2.7 (2018-08-13)0.2.7 ChangelogUpdated 3rd party requirements. Some requirements had changed so it was causing failures0.2.8 (2018-08-30)Add version to Tasks0.2.9 (2018-10-29)Updated 3rd party requirements.0.2.10 (2018-11-27)Updated 3rd party requirements.0.2.11 (2019-02-08)Updated 3rd party requirements.Fixed flake8 issues0.2.12 (2019-04-10)Updated 3rd party requirements.0.2.13 (2019-04-15)Remove the Running status from task instances.Allow owner of task instance to be changed back to null (unassign a task).0.2.14 (2019-06-03)Updated cookiecutter template.0.2.15 (2019-07-26)Updated 3rd party requirements.0.3.0 (2019-08-13)Added a service to help update/create workflows instead of doing it by hand.0.3.1 (2019-08-14)Was missing type for workflow create serviceDropped support for update.  It may not work as intended.0.3.2 (2019-09-09)Optimize current status queries0.3.3 (2019-09-09)Optimize current status queries
Package: django-genshi
Author:John MillikinCopyright:This document has been placed in the public domain.Overviewdjango-genshiis a small wrapper library around Genshi that provides
an API similar todjango.template. Included are imitations ofContextandRequestContext. There is also an implemention of the
Django template loader system adapted for Genshi, and a selection of
shortcut functions.UsageSee theDjango[1]andGenshi[2]documentation for detailed usage notes.
The API ofdjango-genshiis intended to mirror that of Django, while
writing or manipulating the templates will require knowledge of Genshi.Genshi cannot use Django’s default template loaders – to work around this,
theapp_directories,eggs, andfilesystemloaders have been
modified and included in thedjango_genshi.loaderspackage. To avoid
conflicts with Django’s template system, place such loaders in theGENSHI_TEMPLATE_LOADERSsetting.Example:>>> from django_genshi import render_to_response
>>> response = render_to_response ('template_name.xml', {"name": "world"})
>>> print response.content
<h1>Hello world!</h1>[1]http://docs.djangoproject.com/en/dev/ref/templates/api/[2]http://genshi.edgewall.org/wiki/DocumentationOutput Type AutodetectionBecause Genshi is based on abstract markup streams, it is possible for a
template to be rendered to multiple output representations (such as HTML or
XHTML). The decision of which to render is usually based on the HTTPAcceptheader. Theshortcuts.render_to_response_autodetectfunction
implements a reasonable algorithm for autodetecting output formats, and
serves as an example for writing custom encoders in general.FiltersArbitrary Genshi filter functions may be registered, using theGENSHI_TEMPLATE_FILTERSsetting. They will be applied to generated
template streams by the shortcut functions prior to rendering the
streams. Example filters are included in thedjango_genshi.filtersmodule.