starou / django-stachoutils Goto Github PK
View Code? Open in Web Editor NEWStachou's Django utils
License: Other
Stachou's Django utils
License: Other
tests/projects
?
tests/settings.py
? tests/regressiontests/templatetags.py
tests/Makefile
tests/__init__.py
ne sert pas actuellement. test_lowerize()
référence une fonction qui n'existe plus et test_files_are_equal()
ne peut pas marcher car les fichiers de test n'existent pas. def save(self, commit=True):
self.nested_instance = None
if self.nested_form.has_changed():
self.nested_instance = self.nested_form.save()
self.instance = super(NestedModelForm, self).save(commit=commit)
if self.nested_instance:
setattr(self.instance, self._nested.fk, self.nested_instance)
self.instance.save()
return self.instance
This gives a prefix like 'None_OPTIONS
for a options
inline instead of OPTIONS
shortcuts.json_response()
car built-in depuis Django-1.7.get_filters
car les filtres fermés sont gérés en js.When a filter is selected, the last item of a filter (the one that unfilter the current filter) contains 2 GET parameters for the same key :
<div>
<h3><a></a><input type="hidden" name="filter_key" value="last driver" />By last driver</h3>
<ul>
<li><a href="?">All</a></li>
<li><a href="?last_driver__exact=%d">Stanislas Guerra</a></li>
<li class="selected"><a href="?last_driver__exact=%d">Michael Schumacher</a></li>
<li><a href="?last_driver__exact=%d&last_driver__isnull=True">Aucun</a></li>
</ul>
</div>""" % (self.p1.pk, self.p2.pk, self.p2.pk)
Test in test_fk_filters_filtered_generic_list()
tests/forms/test_fields.py:
<img src="{}cache/5f/7f/5f7fd7419603eb53e5519c1eda28e81b.jpg"width="120" height="58">
File "..../venv_publish/lib/python3.6/site-packages/django_stachoutils/management/commands/dumpdata_related.py", line 116, in handle
if len(app_list) != 1 or len(list(app_list.values())[0]) != 1:
TypeError: 'odict_values' object does not support indexing
We have:
<li><a href="?last_driver__exact=%d&last_driver__isnull=True">Aucun</a></li>
Instead of:
<li><a href="?last_driver__isnull=True">Aucun</a></li>
django/db/models/fields/files.py:93: RemovedInDjango110Warning: Backwards compatibility for storage backends without support for the max_length
argument in Storage.get_available_name() will be removed in Django 1.10.
django_stachoutils/views/generic.py:426: RemovedInDjango40Warning: django.utils.translation.ugettext() is deprecated in favor of django.utils.translation.gettext().
django_stachoutils/templatetags/stachoutils_extras.py:177: RemovedInDjango40Warning: django.utils.translation.ugettext() is deprecated in favor of django.utils.translation.gettext().
django_stachoutils/options.py:15: RemovedInDjango40Warning: force_text() is deprecated in favor of force_str().
django_stachoutils/options.py:25: RemovedInDjango40Warning: force_text() is deprecated in favor of force_str().
In discover_field
:
try:
# As of Django 1.9, Field.rel has been replaced with remote_field.
# This may not works (not encountered yet).
mod = mod._meta.get_field(rel_model).remote_field.model
except:
if DJ_VERSION >= (1, 9):
mod = getattr(mod, '%s_set' % rel_model).rel.related_model
elif DJ_VERSION >= (1, 8):
mod = getattr(mod, '%s_set' % rel_model).related.related_model
else:
mod = getattr(mod, '%s_set' % rel_model).related.model
field = mod._meta.get_field(attr)
Exception is never raised.
__init__.py
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.