Saravanan666/pypi-org huggingface dataset:
Package: django-compositepk-model
django-compositepk-modelProvide an extended Django Model class named 'CPkModel' that supports composite primary keys. Also provide an extended Query class 'CPkQuery' that supports multi-column lookups.This package supports treating legacy db tables with a composite primary key, without adding a surrogate key.This is my other approach toticket373.Features1. Easy to useFor a table with a composite primary key, change the base class from Model to CPkModel, and set 'unique_together' in Meta. In addition, set 'primary_key=True' to each primary keys.(model definition sample)fromdjango.dbimportmodelsfromcpkmodelimportCPkModel# Normal Model#   primary_key is auto 'id'classCompany(models.Model):name=models.CharField(max_length=100)established_date=models.DateField()company_code=models.CharField(max_length=100)classMeta:db_table='Company'# Child Model (CpkModel)#   composite primary key: company_id, country_codeclassCompanyBranch(CPkModel):company=models.ForeignKey(Company,primary_key=True,# for CompositePKon_delete=models.CASCADE)country_code=models.CharField(max_length=100,primary_key=True,# for CompositePK)name=models.CharField(max_length=100)established_date=models.DateField()classMeta:db_table='CompanyBranch'unique_together=(('company','country_code'),)# for CompositePKThat's all. No additional definitions or virtual fields are required.2. Admin avairableCPkModel can be used in Django Admin. The values of composite primary key are displayed in a comma separated style. Change(Update), Delete are fine. Add(Create) has a problem that CreateView do unique check to each key Field. So you can't add enough child records. But, this is only CreateView's problem. Your program can create child records by QuerySet or Model method.3. Multi-column lookup avairableTo support composite primary keys, CPkQuery supports multi-column lookups.obj=CompanyBranch.objects.get(pk=(1,'JP'))qs=CompanyBranch.objects.filter(pk='1,JP')qs=CompanyBranch.objects.filter(**{'company,country_code':(1,'JP')})qs=CompanyBranch.objects.filter(**{'company_id,country_code':'1,JP'})LHS with comma is not just primary, also other columns are OK.qs=CompanyBranch.objects.filter(**{'country_code,name':'JP,Google'})Lookup Multi-Column with 'in' is also avairable. PostgreSQL is fine, But SQLite3 is not supported.qs=CompanyBranch.objects.filter(pk__in=[(1,'JP'),(1,'US'),(2,'JP'),])qs=CompanyBranch.objects.filter(**{'country_code,name__in':[('JP','HONDA'),('CN','SONY'),]})4. bulk_update avairable (v1.0.2)bulk_update methond avairable for PostgreSQL. But SQLite3 is not supported.Album.objects.bulk_update(albums,['num_stars',])Installationpip install django-compositepk-modelLinkshttps://code.djangoproject.com/ticket/373https://code.djangoproject.com/wiki/MultipleColumnPrimaryKeyshttps://gijutsu.com/en/2021/01/19/django-composite-primary-key/
Package: django-composition
`django-composition` provides the abstract way to denormalize data from your models in simple declarative way through special generic model field called `CompositionField`.Most cases of data denormalization are pretty common so `django-composition` has several "short-cuts" fields that handles most of them.## Base concept`CompositionField` is django model field that provides interface to data denormalization.`CompositionField` constructor params:- native - Django field instance for current compostion field- trigger - one or some numberr of triggers that handle composition.Trigger is a dict with allowed keys:- on - signal or list of signals that this field handles- do - signals handler, with 3 params:- related instance- instance (that comes with signal send)- concrete signal (one from `on` value)- field_holder_getter - function that gets instance(that comes with signal send)\as parameter and returns field holderobject (related instance)- sender - signal sender- sender_model - model instance or model name that send signal- commit - flag that indicates save instance after trigger appliance or not- commons - a trigger like field with common settingsfor all given triggers- update_method - dict for customization of update_method. Allowed params:- initial - initial value to field before applince of method- do - index of update trigger or trigger itself- queryset - query set or callable(with one param - `instance` of an holder model)that have to retun something iterable- name - custom method name instead of `update_FOO`## Short-cutsHere is the list of provided short-cut fields:- `ForeignAttributeField`- `ChildsAggregationField`- `AtributesAggregationField`
Package: django-compound-field
== django compound field ==This addon allows you to define compound fields, e.g.{{{class AddressField(CompoundField):phone = models.CharField(max_length=30)mobile = models.CharField(max_length=30)fax = models.CharField(max_length=30)email = models.EmailField()}}}compound fields have no representation in the database, they just contribute the fields one by one to their carrier model.== KNOWN BUGS ==* you cannot nest compound fields (because the metaclass collects only Fields, and a CompoundField is not a Field)* you cannot assign the whole compound field during keyword based creation.* the fields in the carrier model are added out-of-order at the end.
Package: django-compoundqueryset
Django-compoundqueryset------------|PyPi|.. |PyPi| image:: https://badge.fury.io/py/django-compoundqueryset.svg:target: https://pypi.python.org/pypi/django-compoundquerysetA little Django app allows for compound querysets between different tables.Especially useful for pagination of said results.Django versions supported: 1.8, 1.9, 1.10Python versions supported: 2.7, 3.3, 3.4, 3.5Installation------------You can obtain the source code for ``django-compoundqueryset`` from here:::https://github.com/brianwawok/django-compoundquerysetUsing `pip`:pip install django-compoundquerysetMotivation-----------Sometimes you might want to combine two different tables with similar fields and show them to users. For example:.. code:: pythonfrom django.db import modelsclass FirstModel(models.Model):age = models.IntegerField()name = models.TextField(max_length=100)color = models.TextField(max_length=100)class SecondModel(models.Model):age = models.IntegerField()name = models.TextField(max_length=100)size = models.IntegerField()And you want to paginate across them.. code:: pythonfrom django.core.paginator import Paginatorfrom djcompoundqueryset import CompoundQuerysetqs_1 = FirstModel.objects.order_by('age').all()qs_2 = SecondModel.objects.order_by('age').all()combined_queryset = qs_1 | qs_2p = Paginator(combined_queryset, 10)You will get the dreaded errorMerging 'QuerySet' classes must involve the same values in each case.Now with django-compoundqueryset, you can do:.. code:: pythonfrom django.core.paginator import Paginatorfrom djcompoundqueryset import CompoundQuerysetqs_1 = FirstModel.objects.order_by('age').all()qs_2 = SecondModel.objects.order_by('age').all()combined_queryset = CompoundQueryset(qs_1, qs_2, max_items=100)p = Paginator(combined_queryset, 10)You can now iterate over these models in a view, showing the age. Max_items says you willnever use more than that many items, so limit the count a queries. Useful if you havecapped pagination.Performance-----------The goal is to beat the naive implementation (load all records into memory and deal with there), butwe may not beat a RawSQL union all monster. If performance is really important you may need to do that.If used in a Django Paginator, we will normally do 1 count(*) query per queryset, and then only load therequired records.
Package: django-compresshtml
django-compresshtml=====================HTML compressor for djangoWhy compress HTML code?=====================When compressed HTML code, you reduce the size of data transferred from your server to your client, and your pages load faster.Installing==========For install django-compresshtml, run on terminal: ::$ [sudo] pip install django-compresshtmlUsing the midleware===================All you need to do is add ``compresshtml.middleware.CompressHtmlMiddleware`` to your ``MIDDLEWARE_CLASSES`` and enable the ``COMPRESS_HTML`` setting:MIDDLEWARE_CLASSES = ('compresshtml.middleware.CompressHtmlMiddleware',# other middleware classes)COMPRESS_HTML = TrueThis middleware should be placed before any other middleware that need to read or write the response body so that compression happens afterward.The default value for the ``COMPRESS_HTML`` setting is ``not DEBUG``. You only need to set it to ``True`` if you want to minify your HTML code when ``DEBUG`` is enabled.Keeping comments----------------The default behaviour of the middleware is remove all comments but conditional comments from HTML. If you want to keep your comments, set the setting ``KEEP_COMMENTS_ON_COMPRESSING`` to ``True``:KEEP_COMMENTS_ON_COMPRESSING = TrueUsing the decorator===================django-compresshtml also provides a decorator, that you can use only on views you want to minify the response:from compresshtml.decorators import compressed_response@compressed_responsedef home(request):return render_to_response('home.html')development===========* Source hosted at `GitHub <https://github.com/kamagatos/django-compresshtml>`* Report issues on `GitHub Issues <https://github.com/kamagatos/django-compresshtml/issues>`Pull requests are very welcomed!Changelog=========0.1-----* Initial commitLICENSE=======Unless otherwise noted, the django-compresshtml source files are distributed under the BSD-style license found in the LICENSE file.
Package: django-compressor
Django Compressor processes, combines and minifies linked and inline
Javascript or CSS in a Django template into cacheable static files.It supports compilers such as coffeescript, LESS and SASS and is
extensible by custom processing steps.How it worksIn your templates, all HTML code between the tags{% compress js/css %}and{% endcompress %}is parsed and searched for CSS or JS. These styles and
scripts are subsequently processed with optional, configurable compilers and
filters.The default filter for CSS rewrites paths to static files to be absolute.
Both Javascript and CSS files are by default concatenated and minified.As the final step the template tag outputs a<script>or<link>tag pointing to the optimized file. Alternatively it can also
inline the resulting content into the original template directly.Since the file name is dependent on the content, these files can be given
a far future expiration date without worrying about stale browser caches.For increased performance, the concatenation and compressing process
can also be run once manually outside of the request/response cycle by using
the Django management commandmanage.py compress.Configurability & ExtensibilityDjango Compressor is highly configurable and extensible. The HTML parsing
is done usinglxmlor if it’s not available Python’s built-in HTMLParser by
default. As an alternative Django Compressor provides aBeautifulSoupand ahtml5libbased parser, as well as an abstract base class that makes it easy to
write a custom parser.Django Compressor also comes with built-in support forYUI CSS and JScompressor,yUglify CSS and JScompressor, Google’sClosure Compiler, a Python port of Douglas Crockford’sJSmin, a Python port
of the YUI CSS Compressorcsscompressorand a filter to convert (some) images intodata URIs.If your setup requires a different compressor or other post-processing
tool it will be fairly easy to implement a custom filter. Simply extend
from one of the available base classes.More documentation about the usage and settings of Django Compressor can be
found ondjango-compressor.readthedocs.org.The source code for Django Compressor can be found and contributed to ongithub.com/django-compressor/django-compressor. There you can also file tickets.The in-development version of Django Compressor can be installed withpip installgit+https://github.com/django-compressor/django-compressor.git
Package: django-compressor-autoprefixer
Django-Compressor-Autoprefixer is usingcode42day/postcss-cliwithpostcss/autoprefixerplugin.INSTALLATIONPython package:pip install django-compressor-autoprefixerNode modules:npm install -g postcss-cli autoprefixerUSAGEAdd to settings.py:COMPRESS_CSS_FILTERS=(# ...'django_compressor_autoprefixer.AutoprefixerFilter',)SETTINGSCOMPRESS_AUTOPREFIXER_BINARY- path autoprefixer binary (if it
not inPATHenvironment variable). Default:postcss.COMPRESS_AUTOPREFIXER_ARGS- arguments for cli tool (seepostcss--help). Default:--useautoprefixerLICENCEMIT LicenseCopyright (C) 2015 by Yuri ShikanovPermission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
“Software”), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Package: django_compressor_celery
A extension of django_compressor which compress the files by celery workers.
The system behind the scene is very simple. The first request on a page with a{% compress %}block will create a celery task which compress this specific block.
Instead to wait for the compressed version the first request gets the uncompressed
version. After the compress task is finished compressor will deliver the compressed
code from the cache directory.Benefits:Support all features of template inheritanceNo offline compression by deploymentInstallInstall as usualdjango-compressorandcelery for djangoInstall django-compressor-celeryAddcompressor_celeryto your installed appsReplace in your template{% load compress %}with{% load compress_celery %}ConfigurationIf you want to change sometask optionsyou should use the settings keyCOMPRESS_CELERY_TASK_CONFIGwhich contains a dict with the options. (Inspired bydjango-celery-email)Example:COMPRESS_CELERY_TASK_CONFIG = {
    'name': 'compressor.lets_compress',
    'queue': 'compressor',
    'ignore_result': False
    ...
}The default config should work well for the most use cases.
Package: django-compressor-js
django-compressor-jsInstead of running an extra node.js process watching for changes in your Javascript, this precompiler fordjango-compressorwill convert any ES6 code into ES5 automagically.Installpip install django-compressor-jsAdd precompiler (text/es6can be anything, but it has to match the script type in the template)COMPRESS_PRECOMPILERS = (
    ("text/es6", "django_compressor_js.precompilers.BabelCompiler"),
)Add to HTML template{% compress js %}
	<script src="{% static 'js/test-es6-code.js' %}" type="text/es6"></script>
{% endcompress %}CaveatsMost ES6 syntax seems to work pretty well, but requiring modules doesn't import correctly. Also, this approach adds some latency when compressing on the fly (i.e.COMPRESS_OFFLINE = False).Run testspoetry run pytestCreditsdukpyanddjango-compressorfor doing all the hard things.
Package: django_compressor_mako
This module providemako templatesupport forDjango Compressor.UsageAll you need to do is to import extension namespace and using it with mako
syntax:<%namespacename="compress"module="django_compressor_mako"/><%compress:compresskind="css"><link rel="stylesheet" href="/static/css/style.css" type="text/css" /></%compress:compress>Almost all django-compressor arguments are supported but must be explicitly
named:kind: mandatory, “css” or “js”.mode: optional, compressor mode, “file” or “inline”.name: is not supported and will raise aNotImplementedErrorOutputscannotbe named and are just named using hash plus extension.Also note that mako template doesn’t allow blocks inside of<%call>, that
meansyou cannot use the following syntax:<%namespacename="compress"module="django_compressor_mako"/><%compress:compresskind="css"><%blockname="more_css"/></%compress:compress>Offline compressionIn order to use offline compression you must first create cached compressed
files and manifest usingpython ./manage.py compress_mako.Shorter functionsAdditionally two shorter functions are provided,cssandjs, same
arguments can be passed exceptkindwhich is set by default depending on
which one is used, eg.:<%namespacename="compress"module="django_compressor_mako"/><%compress:css><link rel="stylesheet" href="/static/css/style.css" type="text/css" /></%compress:css><%compress:js><script type="text/javascript" src="/static/js/script.js"></%compress:js>
Package: django-compressor-postcss
This module will let you use PostCSS as a filter with django-compressor.
You can use any postcss plugin you wish (assuming the plugin is
installed).InstallationInstall this package:pip install django-compressor-postcssYou also need to install the postcss tool itself and depending on what
plugins you plan to use, you should install those manually.Example:sudo npm install -g postcss-cli
sudo npm install -g autoprefixer postcss-font-magicianConfigurationYour Django’s settings should look something like below.COMPRESS_CSS_FILTERS=(..'compressor_postcss.PostCSSFilter',..)COMPRESS_POSTCSS_PLUGINS=('autoprefixer','postcss-font-magician')COMPRESS_POSTCSS_PLUGINSdetermines the plugins that PostCSS will
use.
Package: django-compress-storage
Django Compress Storage=======================|Build Status| |Latest Version| |BSD License| |Pypi Download|Custom ZipFileField for Django that auto compact file uploadedInstall-------.. code:: bashpip install django-compress-storageor by source code.. code:: bashgit clone https://github.com/valdergallo/django-compress-storage/python setup.py installFeatures---------  Compress FileUpload storage file with Zip-  Delete old file that was compressed on zip-  Support for South Migrations-  Support Django 1.2+-  Celery 2.5+ support - async compress file with Celery-  Windows Support-  Linux support-  OSx support-  Support for Python3-  Support for Python2.6+Motivation----------On my job we need save all upload files for 5 year. Losing a lot spaceon server with this files, because this I created this application.Django Settings Configurations------------------------------.. code:: pythonFILE_COMPRESS_DELETE_OLD_FILE = True # to delete old files after compressedFILE_COMPRESS_DELETE_OLD_FILE = False # to not delete old files after compressed# Feature only for version v9.0+FILE_COMPRESS_QUEUE = 'Celery' # by default queue is Celery, but you can change this with this var on settingsINSTALLED_APPS = (......'compress_storage',)Usage-----.. code:: python# example model.pyfrom django.db import modelsfrom compress_storage import ZipFileFieldclass MyContent(models.Model):name = models.CharField(max_length=150)create_date = models.DateTimeField(auto_now=True)upload_file = ZipFileField(upload_to='mycontent/')def __unicode__(self):return self.nameShell-----.. code:: python>>> from example.core import MyContent>>> m = MyContent.objects.get(id=2)>>> m.upload_file<ZipCompressFieldFile: mycontent/test.txt>>>> m.upload_file.compress()>>> m.upload_file<ZipCompressFieldFile: mycontent/test.zip>Using with Celery-----------------If Celery are installed on Site Packages. You just need create onepost\_save on your model to use async compress... code:: python# listeners.py filefrom django.db.models.signals import post_savedef auto_compress_file_on_post_save(sender, instance, **kargs):instance.upload_file.compress()post_save.connect(auto_compress_file_on_post_save, sender=MyContent)If you don´t wanna use Celery async compress:.. code:: pythondef auto_compress_file_on_post_save(sender, instance, **kargs):instance.upload_file.compress(async=False)post_save.connect(auto_compress_file_on_post_save, sender=MyContent).
Package: django-comps
django-comps==========================An app that facilitates rapid prototyping.Provides an entry point for deeper integration of front end designers withlittle to no experienceinto a project.Features-------Protypes can be built in the ``COMPS_DIR`` and render within he context ofa Django project, without the need for defined views.* Take advantage of the templating engine* No need to pre-configure urls and views during prototyping* Onboard new designers to the wonders of DjangoInstallation------------django-comps requires Django >= 1.4 and Python >= 2.6.``pip install django-comps``Documentation-------------Documentation on using django-comps is available on[Read The Docs](http://readthedocs.org/docs/django-comps/).License--------------------------------------django-comps is released under the BSD License. See the[LICENSE](https://github.com/daaray/django-comps/blob/master/LICENSE) file for more details.Contributing--------------------------------------If you think you've found a bug or are interested in contributing to this projectcheck out [django-comps on Github](https://github.com/daaray/django-comps>).
Package: django-comptes
ComptesButCeci est une application de gestion de petits comptes entre amis, nottament pour des occasions précises, telles qu’une semaine de vacances… Ou de dur labeur à la Ferté Bernard.PrincipeQuand quelqu’un règle pour quelque chose qui bénéficie à plusieurs personne, comme un pot de Nutella ou la facture d’une Pizzeria, on l’entre comme une «Dette».L’application calcule alors un «Solde», où la banque est en fait le groupe de personne : un solde positif indique que le groupe nous doit de l’argent (c’est toujours bien, un solde positif…)Pour rééquilibrer la balance (ou toute autre raison), on peut également entrer des «Remboursements», qui correspondent à une quantité d’argent donnée directement à une personne par une autre.Une fois l’évènement finis, les gens se remboursent, on cloture l’«Occasion» et on n’en parle plus.PersoCette application est prévue pour fonctionner avec mon site web personnel,https://saurel.me, mais rien ne vous empêche d’essayer de l’utiliser ailleurs, et/ou de contribuer !