Contribute to Open Source. Search issue labels to find the right project for you!

[cmake] fix for cmake < 3.6

alicevision/CCTag

generator expressions seems not to be handled correctly in older versions of cmake (eg 3.5) insideinclude_directories (ie it sends at command line the whole expression without first resolving it, thus causing the building to fail).

In any case it was not necessary as the set_target_properties() that comes next will properly set the includes to propagate. This is on me, it must have slipped through the tests i made when refactoring the cmakelists.

Updated 27/03/2017 12:23

les:flowcontrol: fix division by zero for lightserv flag

ethereum/go-ethereum

Currently geth crashes if the users specifies a value of 100 for the --lightserv flag due to a division by zero panic. Another problem occurs if the user specifies > 100, in that case there are no resources allowed for handling light client requests which is probably not what the user meant.

This PR will only do throttling in case the user specified <100. Otherwise it would set the throttle threshold to such a high value that it will effectively never be reached.

Updated 27/03/2017 09:16 1 Comments

[WIP] Integration fixes

sous-chefs/varnish

Description

  • Rename distro_install tests to distro so that they get picked up by kitchen.
  • Right now we can’t guarantee the repo package will get used if it is an older version then the distro’s. We can fix this by pinning but since the main reason to not install the distro’s version is because it’s older it probably makes more sense just to document this. Still possible for the user to do this if they want.
  • The reload-vcl script hasn’t been updated in ubuntu’s repo yet, this was missed before due to the issue with the distro specific integration tests. Made a bug report for this on ubuntu’s package, would prefer not to add this back again so hopefully they can get that fixed soon.

Issues Resolved

https://github.com/sous-chefs/varnish/issues/126

Contribution Check List

  • [ ] All tests pass.
  • [ ] New functionality includes testing.
  • [ ] New functionality has been documented in the README if applicable
Updated 27/03/2017 02:46 1 Comments

[WIP] Fixes for varnishlog

sous-chefs/varnish

Description

  • Links /etc/sysconfig/varnishlog varnishncsa to defaults file in /etc/default. Fixes https://github.com/sous-chefs/varnish/issues/125.
  • Rename default ncsa log file to varnishncsa. This is what is used upstream and also fixes an issue where the ncsa and varnish log output to the same file when you enable ncsa without disabling varnishlog.
  • Remove double quotes from default ncsa_format_string, this was likely meant to prevent word splitting in the init.d script but does not work and instead add’s quotes to the log format.

Issues Resolved

  • https://github.com/sous-chefs/varnish/issues/125.

Contribution Check List

  • [ ] All tests pass.
  • [x] New functionality includes testing.
  • [ ] New functionality has been documented in the README if applicable
Updated 27/03/2017 02:23

RangeError: Invalid array buffer length (Chrome)

BrechtDeMan/WebAudioEvaluationTool

Trying quick set up - cannot access the .wav files - “LISTEN” button greyed out. Get error:

“Uncaught RangeError: Invalid typed array length at new Float32Array (native) at calculateMeanSquared (http://localhost:8000/js/loudness.js:87:17) at OfflineAudioContext.offlineContext.oncomplete (http://localhost:8000/js/loudness.js:61:26)”

Debugger shows array length = -4 on further investigation. I’m new to all this so it is possibly my set up. Using Windows 10 Home, version 1607. 64-bit OS. Tried Chrome recent chrome Version 57.0.2987.110, also Mozilla Firefox most recent. Updated Java. Localhost server through Python (2.7) used also.

Desperate to use this program for audio listening test I need to run from my degree. Thanks for your help. Here is a screen shot:

image

Updated 27/03/2017 12:26 4 Comments

Show default shop currency/lang fix #1981

reactioncommerce/reaction
  • [ ] Clearly explain what your PR is trying to accomplish. A link to an issue is best It fixes observations in issue #1981.
  • [ ] Provide us detailed instructions on how we can test your PR Shop should have 1 default currency and language. When All Off is clicked, Dropdown should not be blank. It should show the Shop value selected for currency and language.
Updated 25/03/2017 09:32

Begin to break templates away from scripts

elastic/elasticsearch

First: I’m genuinely sorry to whoever reviews this. It is big and will need to be looked at carefully.

This starts the process of breaking scripts and templates. I’ve intentionally preserved abstractions that will be lost eventually in an attempt to keep this change as small as I figured I could get away with while still enabling us to change things later. I believe I’ve preserved 95% of backwards compatibility. This is what I know I’ve broken:

  • The plugin interface
  • The transport client with regard to templates
  • The stored template APIs during the 5.x to 6.0 upgrade. They should work just fine outside of the upgrade.

Here are some things I intentionally didn’t change that we probably will want to change later:

  • Internally we use the Script object to refer to templates. This is pretty silly and the new TemplateService doesn’t require it. I didn’t change this to keep the PR small. It should be a followup.
  • I believe as a followup to that we should be able to remove some things from Script.
  • TemplateService.Backend is the same as ScriptEngineService. I didn’t change this to keep the PR small. It should be a followup.

Things I didn’t change that we might want to change at some point but we’ll need to be super careful about so we don’t break backwards compatibility:

  • File templates are still loaded from the config/scripts directory every few seconds.
  • Templates stored in the cluster state are still stored in the ScriptMetaData.
  • Statistics related to templates and scripts are still collected together.

Originally I’d planned to backport this to 5.x as well as commit to master but right now I don’t have any appetite for it.

Updated 25/03/2017 15:04 3 Comments

DateFieldType#parseToMilliseconds should return Long values directly

elastic/elasticsearch

Currently DateFieldType#parseToMilliseconds parses the toString representation if long values are directly passed in, e.g. as bound in a RangeQuery. This is not only inefficient but also introduces strange edge cases like the Long.MAX_VALUE overflow exibited in #23436 that results in a wrong rewrite of the query. Instead of converting long values to String and parse them back we should directly return them. Rounding and time zone settings should not effect those values since they are assumed to be UTC.

Closes #23436

Updated 27/03/2017 12:26 1 Comments

Update cffi to 1.10.0

mozilla/telemetry-analysis-service

There’s a new version of cffi available. You are currently using 1.9.1. I have updated it to 1.10.0

These links might come in handy: <a href=“http://pypi.python.org/pypi/cffi”>PyPI</a> | <a href=“http://cffi.readthedocs.org”>Docs</a>

I couldn’t find a changelog for this release. Do you know where I can find one? Tell me!

Got merge conflicts? Close this PR and delete the branch. I’ll create a new PR for you.

Happy merging! 🤖

Updated 24/03/2017 16:07

Update botocore to 1.5.29

mozilla/telemetry-analysis-service

There’s a new version of botocore available. You are currently using 1.5.26. I have updated it to 1.5.29

These links might come in handy: <a href=“http://pypi.python.org/pypi/botocore”>PyPI</a> | <a href=“https://pyup.io/changelogs/botocore/”>Changelog</a> | <a href=“https://github.com/boto/botocore”>Repo</a>

Changelog

1.5.29


  • api-change:cloudtrail: Update cloudtrail client to latest version
  • api-change:application-autoscaling: Update application-autoscaling client to latest version

1.5.28


  • api-change:discovery: Update discovery client to latest version
  • api-change:lambda: Update lambda client to latest version

1.5.27


  • api-change:pinpoint: Update pinpoint client to latest version
  • api-change:directconnect: Update directconnect client to latest version
  • enhancement:Credentials: Add support for localhost when using container credential provider (1160 &lt;https://github.com/boto/botocore/issues/1160&gt;__)
  • api-change:codebuild: Update codebuild client to latest version
  • api-change:marketplacecommerceanalytics: Update marketplacecommerceanalytics client to latest version
  • api-change:rekognition: Update rekognition client to latest version

Got merge conflicts? Close this PR and delete the branch. I’ll create a new PR for you.

Happy merging! 🤖

Updated 24/03/2017 16:19 1 Comments

Update gunicorn to 19.7.1

mozilla/telemetry-analysis-service

There’s a new version of gunicorn available. You are currently using 19.7.0. I have updated it to 19.7.1

These links might come in handy: <a href=“http://pypi.python.org/pypi/gunicorn”>PyPI</a> | <a href=“https://pyup.io/changelogs/gunicorn/”>Changelog</a> | <a href=“http://gunicorn.org”>Homepage</a>

Changelog

19.7.1


  • fix: continue if SO_REUSEPORT seems to be available but fails (:issue:1480)
  • fix: support non-decimal values for the umask command line option (:issue:1325)

Got merge conflicts? Close this PR and delete the branch. I’ll create a new PR for you.

Happy merging! 🤖

Updated 24/03/2017 16:23 1 Comments

Update django to 1.10.6

mozilla/telemetry-analysis-service

There’s a new version of Django available. You are currently using 1.9.12. I have updated it to 1.10.6

These links might come in handy: <a href=“http://pypi.python.org/pypi/Django”>PyPI</a> | <a href=“https://pyup.io/changelogs/django/”>Changelog</a> | <a href=“https://www.djangoproject.com/”>Homepage</a>

Changelog

1.10.6


March 1, 2017

Django 1.10.6 fixes several bugs in 1.10.5.

Bugfixes

  • Fixed ClearableFileInput’s "Clear" checkbox on model form fields where the model field has a default (:ticket:27805).

  • Fixed RequestDataTooBig and TooManyFieldsSent exceptions crashing rather than generating a bad request response (:ticket:27820).

  • Fixed a crash on Oracle and PostgreSQL when subtracting DurationField or IntegerField from DateField (:ticket:27828).

  • Fixed query expression date subtraction accuracy on PostgreSQL for differences larger than a month (:ticket:27856).

  • Fixed a GDALException raised by GDALClose on GDAL ≥ 2.0 (:ticket:27479).


1.10.5


January 4, 2017

Django 1.10.5 fixes several bugs in 1.10.4.

Bugfixes

  • Fixed a crash in the debug view if request.user can't be retrieved, such as if the database is unavailable (:ticket:27567).

  • Fixed occasional missing plural forms in JavaScriptCatalog (:ticket:27418).

  • Fixed a regression in the timesince and timeuntil filters that caused incorrect results for dates in a leap year (:ticket:27637).

  • Fixed a regression where collectstatic overwrote newer files in remote storages (:ticket:27658).


1.10.4


December 1, 2016

Django 1.10.4 fixes several bugs in 1.10.3.

Bugfixes

  • Quoted the Oracle test user's password in queries to fix the "ORA-00922: missing or invalid option" error when the password starts with a number or special character (:ticket:27420).

  • Fixed incorrect app_label / model_name arguments for allow_migrate() in makemigrations migration consistency checks (:ticket:27461).

  • Made Model.delete(keep_parents=True) preserve parent reverse relationships in multi-table inheritance (:ticket:27407).

  • Fixed a QuerySet.update() crash on SQLite when updating a DateTimeField with an F() expression and a timedelta (:ticket:27544).

  • Prevented LocaleMiddleware from redirecting on URLs that should return 404 when using prefix_default_language=False (:ticket:27402).

  • Prevented an unnecessary index from being created on an InnoDB ForeignKey when the field was added after the model was created (:ticket:27558).


1.10.3


November 1, 2016

Django 1.10.3 fixes two security issues and several bugs in 1.10.2.

User with hardcoded password created when running tests on Oracle

When running tests with an Oracle database, Django creates a temporary database user. In older versions, if a password isn't manually specified in the database settings TEST dictionary, a hardcoded password is used. This could allow an attacker with network access to the database server to connect.

This user is usually dropped after the test suite completes, but not when using the manage.py test --keepdb option or if the user has an active session (such as an attacker's connection).

A randomly generated password is now used for each test run.

DNS rebinding vulnerability when DEBUG=True

Older versions of Django don't validate the Host header against settings.ALLOWED_HOSTS when settings.DEBUG=True. This makes them vulnerable to a DNS rebinding attack &lt;http://benmmurphy.github.io/blog/2016/07/11/rails-webconsole-dns-rebinding/&gt;_.

While Django doesn't ship a module that allows remote code execution, this is at least a cross-site scripting vector, which could be quite serious if developers load a copy of the production database in development or connect to some production services for which there's no development instance, for example. If a project uses a package like the django-debug-toolbar, then the attacker could execute arbitrary SQL, which could be especially bad if the developers connect to the database with a superuser account.

settings.ALLOWED_HOSTS is now validated regardless of DEBUG. For convenience, if ALLOWED_HOSTS is empty and DEBUG=True, the following variations of localhost are allowed [&#39;localhost&#39;, &#39;127.0.0.1&#39;, &#39;::1&#39;]. If your local settings file has your production ALLOWED_HOSTS value, you must now omit it to get those fallback values.

Bugfixes

  • Allowed User.is_authenticated and User.is_anonymous properties to be tested for set membership (:ticket:27309).

  • Fixed a performance regression when running migrate in projects with RenameModel operations (:ticket:27279).

  • Added model_name to the allow_migrate() calls in makemigrations (:ticket:27200).

  • Made the JavaScriptCatalog view respect the packages argument; previously it was ignored (:ticket:27374).

  • Fixed QuerySet.bulk_create() on PostgreSQL when the number of objects is a multiple plus one of batch_size (:ticket:27385).

  • Prevented i18n_patterns() from using too much of the URL as the language to fix a use case for prefix_default_language=False (:ticket:27063).

  • Replaced a possibly incorrect redirect from SessionMiddleware when a session is destroyed in a concurrent request with a SuspiciousOperation to indicate that the request can't be completed (:ticket:27363).


1.10.2


October 1, 2016

Django 1.10.2 fixes several bugs in 1.10.1.

Bugfixes

  • Fixed a crash in MySQL database validation where SELECT sql_mode doesn't return a result (:ticket:27180).

  • Allowed combining contrib.postgres.search.SearchQuery with more than one &amp; or | operators (:ticket:27143).

  • Disabled system check for URL patterns beginning with a '/' when APPEND_SLASH=False (:ticket:27238).

  • Fixed model form default fallback for CheckboxSelectMultiple, MultiWidget, FileInput, SplitDateTimeWidget, SelectDateWidget, and SplitArrayWidget (:ticket:27186). Custom widgets affected by this issue should implement :meth:~django.forms.Widget.value_omitted_from_data.

  • Fixed a crash in runserver logging during a "Broken pipe" error (:ticket:27271).

  • Fixed a regression where unchanged localized date/time fields were listed as changed in the admin's model history messages (:ticket:27302).


1.10.1


September 1, 2016

Django 1.10.1 fixes several bugs in 1.10.

Bugfixes

  • Fixed a crash in MySQL connections where SELECT SQL_AUTO_IS_NULL doesn't return a result (:ticket:26991).

  • Allowed User.is_authenticated and User.is_anonymous properties to be compared using ==, !=, and | (:ticket:26988, :ticket:27154).

  • Removed the broken BaseCommand.usage() method which was for optparse support (:ticket:27000).

  • Fixed a checks framework crash with an empty Meta.default_permissions (:ticket:26997).

  • Fixed a regression in the number of queries when using RadioSelect with a ModelChoiceField form field (:ticket:27001).

  • Fixed a crash if request.META[&#39;CONTENT_LENGTH&#39;] is an empty string (:ticket:27005).

  • Fixed the isnull lookup on a ForeignKey with its to_field pointing to a CharField or pointing to a CharField defined with primary_key=True (:ticket:26983).

  • Prevented the migrate command from raising InconsistentMigrationHistory in the presence of unapplied squashed migrations (:ticket:27004).

  • Fixed a regression in Client.force_login() which required specifying a backend rather than automatically using the first one if multiple backends are configured (:ticket:27027).

  • Made QuerySet.bulk_create() properly initialize model instances on backends, such as PostgreSQL, that support returning the IDs of the created records so that many-to-many relationships can be used on the new objects (:ticket:27026).

  • Fixed crash of django.views.static.serve() with show_indexes enabled (:ticket:26973).

  • Fixed ClearableFileInput to avoid the required HTML attribute when initial data exists (:ticket:27037).

  • Fixed annotations with database functions when combined with lookups on PostGIS (:ticket:27014).

  • Reallowed the {% for %} tag to unpack any iterable (:ticket:27058).

  • Made makemigrations skip inconsistent history checks on non-default databases if database routers aren't in use or if no apps can be migrated to the database (:ticket:27054, :ticket:27110, :ticket:27142).

  • Removed duplicated managers in Model._meta.managers (:ticket:27073).

  • Fixed contrib.admindocs crash when a view is in a class, such as some of the admin views (:ticket:27018).

  • Reverted a few admin checks that checked field.many_to_many back to isinstance(field, models.ManyToManyField) since it turned out the checks weren't suitable to be generalized like that (:ticket:26998).

  • Added the database alias to the InconsistentMigrationHistory message raised by makemigrations and migrate (:ticket:27089).

  • Fixed the creation of ContentType and Permission objects for models of applications without migrations when calling the migrate command with no migrations to apply (:ticket:27044).

  • Included the already applied migration state changes in the Apps instance provided to the pre_migrate signal receivers to allow ContentType renaming to be performed on model rename (:ticket:27100).

  • Reallowed subclassing UserCreationForm without USERNAME_FIELD in Meta.fields (:ticket:27111).

  • Fixed a regression in model forms where model fields with a default that didn't appear in POST data no longer used the default (:ticket:27039).


1.10


August 1, 2016

Welcome to Django 1.10!

These release notes cover the :ref:new features &lt;whats-new-1.10&gt;, as well as some :ref:backwards incompatible changes &lt;backwards-incompatible-1.10&gt; you'll want to be aware of when upgrading from Django 1.9 or older versions. We've :ref:dropped some features &lt;removed-features-1.10&gt; that have reached the end of their deprecation cycle, and we've :ref:begun the deprecation process for some features &lt;deprecated-features-1.10&gt;.

See the :doc:/howto/upgrade-version guide if you're updating an existing project.

Python compatibility

Like Django 1.9, Django 1.10 requires Python 2.7, 3.4, or 3.5. We highly recommend and only officially support the latest release of each series.

.. _whats-new-1.10:

What's new in Django 1.10

Full text search for PostgreSQL

django.contrib.postgres now includes a :doc:collection of database functions &lt;/ref/contrib/postgres/search&gt; to allow the use of the full text search engine. You can search across multiple fields in your relational database, combine the searches with other lookups, use different language configurations and weightings, and rank the results by relevance.

It also now includes trigram support, using the :lookup:trigram_similar lookup, and the :class:~django.contrib.postgres.search.TrigramSimilarity and :class:~django.contrib.postgres.search.TrigramDistance expressions.

New-style middleware

:doc:A new style of middleware is introduced &lt;/topics/http/middleware&gt; to solve the lack of strict request/response layering of the old-style of middleware described in DEP 0005 &lt;https://github.com/django/deps/blob/master/final/0005-improved-middleware.rst&gt;_. You'll need to :ref:adapt old, custom middleware &lt;upgrading-middleware&gt; and switch from the MIDDLEWARE_CLASSES setting to the new :setting:MIDDLEWARE setting to take advantage of the improvements.

Official support for Unicode usernames

The :class:~django.contrib.auth.models.User model in django.contrib.auth originally only accepted ASCII letters in usernames. Although it wasn't a deliberate choice, Unicode characters have always been accepted when using Python 3.

The username validator now explicitly accepts Unicode letters by default on Python 3 only. This default behavior can be overridden by changing the :attr:~django.contrib.auth.models.User.username_validator attribute of the User model, or to any proxy of that model, using either :class:~django.contrib.auth.validators.ASCIIUsernameValidator or :class:~django.contrib.auth.validators.UnicodeUsernameValidator. Custom user models may also use those validators.

Minor features

:mod:django.contrib.admin ~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • For sites running on a subpath, the default :attr:URL for the &quot;View site&quot; link &lt;django.contrib.admin.AdminSite.site_url&gt; at the top of each admin page will now point to request.META[&#39;SCRIPT_NAME&#39;] if set, instead of /.

  • The success message that appears after adding or editing an object now contains a link to the object's change form.

  • All inline JavaScript is removed so you can enable the Content-Security-Policy HTTP header if you wish.

  • The new :attr:InlineModelAdmin.classes &lt;django.contrib.admin.InlineModelAdmin.classes&gt; attribute allows specifying classes on inline fieldsets. Inlines with a collapse class will be initially collapsed and their header will have a small "show" link.

  • If a user doesn't have the add permission, the object-tools block on a model's changelist will now be rendered (without the add button, of course). This makes it easier to add custom tools in this case.

  • The :class:~django.contrib.admin.models.LogEntry model now stores change messages in a JSON structure so that the message can be dynamically translated using the current active language. A new LogEntry.get_change_message() method is now the preferred way of retrieving the change message.

  • Selected objects for fields in ModelAdmin.raw_id_fields now have a link to object's change form.

  • Added "No date" and "Has date" choices for DateFieldListFilter if the field is nullable.

  • The jQuery library embedded in the admin is upgraded from version 2.1.4 to 2.2.3.

:mod:django.contrib.auth ~~~~~~~~~~~~~~~~~~~~~~~~~~

  • Added support for the :ref:Argon2 password hash &lt;argon2_usage&gt;. It's recommended over PBKDF2, however, it's not the default as it requires a third-party library.

  • The default iteration count for the PBKDF2 password hasher has been increased by 25%. This backwards compatible change will not affect users who have subclassed django.contrib.auth.hashers.PBKDF2PasswordHasher to change the default value.

  • The :func:~django.contrib.auth.views.logout view sends "no-cache" headers to prevent an issue where Safari caches redirects and prevents a user from being able to log out.

  • Added the optional backend argument to :func:~django.contrib.auth.login to allow using it without credentials.

  • The new :setting:LOGOUT_REDIRECT_URL setting controls the redirect of the :func:~django.contrib.auth.views.logout view, if the view doesn't get a next_page argument.

  • The new redirect_authenticated_user parameter for the :func:~django.contrib.auth.views.login view allows redirecting authenticated users visiting the login page.

  • The new :class:~django.contrib.auth.backends.AllowAllUsersModelBackend and :class:~django.contrib.auth.backends.AllowAllUsersRemoteUserBackend ignore the value of User.is_active, while :class:~django.contrib.auth.backends.ModelBackend and :class:~django.contrib.auth.backends.RemoteUserBackend now reject inactive users.

:mod:django.contrib.gis ~~~~~~~~~~~~~~~~~~~~~~~~~

  • :ref:Distance lookups &lt;distance-lookups&gt; now accept expressions as the distance value parameter.

  • The new :attr:GEOSGeometry.unary_union &lt;django.contrib.gis.geos.GEOSGeometry.unary_union&gt; property computes the union of all the elements of this geometry.

  • Added the :meth:GEOSGeometry.covers() &lt;django.contrib.gis.geos.GEOSGeometry.covers&gt; binary predicate.

  • Added the :meth:GDALBand.statistics() &lt;django.contrib.gis.gdal.GDALBand.statistics&gt; method and :attr:~django.contrib.gis.gdal.GDALBand.mean and :attr:~django.contrib.gis.gdal.GDALBand.std attributes.

  • Added support for the :class:~django.contrib.gis.db.models.MakeLine aggregate and :class:~django.contrib.gis.db.models.functions.GeoHash function on SpatiaLite.

  • Added support for the :class:~django.contrib.gis.db.models.functions.Difference, :class:~django.contrib.gis.db.models.functions.Intersection, and :class:~django.contrib.gis.db.models.functions.SymDifference functions on MySQL.

  • Added support for instantiating empty GEOS geometries.

  • The new :attr:~django.contrib.gis.geos.WKTWriter.trim and :attr:~django.contrib.gis.geos.WKTWriter.precision properties of :class:~django.contrib.gis.geos.WKTWriter allow controlling output of the fractional part of the coordinates in WKT.

  • Added the :attr:LineString.closed &lt;django.contrib.gis.geos.LineString.closed&gt; and :attr:MultiLineString.closed &lt;django.contrib.gis.geos.MultiLineString.closed&gt; properties.

  • The :doc:GeoJSON serializer &lt;/ref/contrib/gis/serializers&gt; now outputs the primary key of objects in the properties dictionary if specific fields aren't specified.

  • The ability to replicate input data on the :meth:GDALBand.data() &lt;django.contrib.gis.gdal.GDALBand.data&gt; method was added. Band data can now be updated with repeated values efficiently.

  • Added database functions :class:~django.contrib.gis.db.models.functions.IsValid and :class:~django.contrib.gis.db.models.functions.MakeValid, as well as the :lookup:isvalid lookup, all for PostGIS. This allows filtering and repairing invalid geometries on the database side.

  • Added raster support for all :doc:spatial lookups &lt;/ref/contrib/gis/geoquerysets&gt;.

:mod:django.contrib.postgres ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • For convenience, :class:~django.contrib.postgres.fields.HStoreField now casts its keys and values to strings.

:mod:django.contrib.sessions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • The :djadmin:clearsessions management command now removes file-based sessions.

:mod:django.contrib.sites ~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • The :class:~django.contrib.sites.models.Site model now supports :ref:natural keys &lt;topics-serialization-natural-keys&gt;.

:mod:django.contrib.staticfiles ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • The :ttag:static template tag now uses django.contrib.staticfiles if it's in INSTALLED_APPS. This is especially useful for third-party apps which can now always use {% load static %} (instead of {% load staticfiles %} or {% load static from staticfiles %}) and not worry about whether or not the staticfiles app is installed.

  • You can :ref:more easily customize &lt;customize-staticfiles-ignore-patterns&gt; the collectstatic --ignore_patterns option with a custom AppConfig.

Cache ~~~~~

  • The file-based cache backend now uses the highest pickling protocol.

CSRF ~~~~

  • The default :setting:CSRF_FAILURE_VIEW, views.csrf.csrf_failure() now accepts an optional template_name parameter, defaulting to &#39;403_csrf.html&#39;, to control the template used to render the page.

  • To protect against BREACH_ attacks, the CSRF protection mechanism now changes the form token value on every request (while keeping an invariant secret which can be used to validate the different tokens).

.. _BREACH: http://breachattack.com/

Database backends ~~~~~~~~~~~~~~~~~

  • Temporal data subtraction was unified on all backends.

  • If the database supports it, backends can set DatabaseFeatures.can_return_ids_from_bulk_insert=True and implement DatabaseOperations.fetch_returned_insert_ids() to set primary keys on objects created using QuerySet.bulk_create().

  • Added keyword arguments to the as_sql() methods of various expressions (Func, When, Case, and OrderBy) to allow database backends to customize them without mutating self, which isn't safe when using different database backends. See the arg_joiner and **extra_context parameters of :meth:Func.as_sql() &lt;django.db.models.Func.as_sql&gt; for an example.

File Storage ~~~~~~~~~~~~

  • Storage backends now present a timezone-aware API with new methods :meth:~django.core.files.storage.Storage.get_accessed_time, :meth:~django.core.files.storage.Storage.get_created_time, and :meth:~django.core.files.storage.Storage.get_modified_time. They return a timezone-aware datetime if :setting:USE_TZ is True and a naive datetime in the local timezone otherwise.

  • The new :meth:Storage.generate_filename() &lt;django.core.files.storage.Storage.generate_filename&gt; method makes it easier to implement custom storages that don't use the os.path calls previously in :class:~django.db.models.FileField.

Forms ~~~~~

  • Form and widget Media is now served using :mod:django.contrib.staticfiles if installed.

  • The &lt;input&gt; tag rendered by :class:~django.forms.CharField now includes a minlength attribute if the field has a min_length.

  • Required form fields now have the required HTML attribute. Set the new :attr:Form.use_required_attribute &lt;django.forms.Form.use_required_attribute&gt; attribute to False to disable it. The required attribute isn't included on forms of formsets because the browser validation may not be correct when adding and deleting formsets.

Generic Views ~~~~~~~~~~~~~

  • The :class:~django.views.generic.base.View class can now be imported from django.views.

Internationalization ~~~~~~~~~~~~~~~~~~~~

  • The :func:~django.conf.urls.i18n.i18n_patterns helper function can now be used in a root URLConf specified using :attr:request.urlconf &lt;django.http.HttpRequest.urlconf&gt;.

  • By setting the new prefix_default_language parameter for :func:~django.conf.urls.i18n.i18n_patterns to False, you can allow accessing the default language without a URL prefix.

  • :func:~django.views.i18n.set_language now returns a 204 status code (No Content) for AJAX requests when there is no next parameter in POST or GET.

  • The :class:~django.views.i18n.JavaScriptCatalog and :class:~django.views.i18n.JSONCatalog class-based views supersede the deprecated javascript_catalog() and json_catalog() function-based views. The new views are almost equivalent to the old ones except that by default the new views collect all JavaScript strings in the djangojs translation domain from all installed apps rather than only the JavaScript strings from :setting:LOCALE_PATHS.

Management Commands ~~~~~~~~~~~~~~~~~~~

  • :func:~django.core.management.call_command now returns the value returned from the command.handle() method.

  • The new :option:check --fail-level option allows specifying the message level that will cause the command to exit with a non-zero status.

  • The new :option:makemigrations --check option makes the command exit with a non-zero status when model changes without migrations are detected.

  • :djadmin:makemigrations now displays the path to the migration files that it generates.

  • The :option:shell --interface option now accepts python to force use of the "plain" Python interpreter.

  • The new :option:shell --command option lets you run a command as Django and exit, instead of opening the interactive shell.

  • Added a warning to :djadmin:dumpdata if a proxy model is specified (which results in no output) without its concrete parent.

  • The new :attr:BaseCommand.requires_migrations_checks &lt;django.core.management.BaseCommand.requires_migrations_checks&gt; attribute may be set to True if you want your command to print a warning, like :djadmin:runserver does, if the set of migrations on disk don't match the migrations in the database.

  • To assist with testing, :func:~django.core.management.call_command now accepts a command object as the first argument.

  • The :djadmin:shell command supports tab completion on systems using libedit, e.g. Mac OSX.

  • The :djadmin:inspectdb command lets you choose what tables should be inspected by specifying their names as arguments.

Migrations ~~~~~~~~~~

  • Added support for serialization of enum.Enum objects.

  • Added the elidable argument to the :class:~django.db.migrations.operations.RunSQL and :class:~django.db.migrations.operations.RunPython operations to allow them to be removed when squashing migrations.

  • Added support for :ref:non-atomic migrations &lt;non-atomic-migrations&gt; by setting the atomic attribute on a Migration.

  • The migrate and makemigrations commands now :ref:check for a consistent migration history &lt;migration-history-consistency&gt;. If they find some unapplied dependencies of an applied migration, InconsistentMigrationHistory is raised.

  • The :func:~django.db.models.signals.pre_migrate and :func:~django.db.models.signals.post_migrate signals now dispatch their migration plan and apps.

Models ~~~~~~

  • Reverse foreign keys from proxy models are now propagated to their concrete class. The reverse relation attached by a :class:~django.db.models.ForeignKey pointing to a proxy model is now accessible as a descriptor on the proxied model class and may be referenced in queryset filtering.

  • The new :meth:Field.rel_db_type() &lt;django.db.models.Field.rel_db_type&gt; method returns the database column data type for fields such as ForeignKey and OneToOneField that point to another field.

  • The :attr:~django.db.models.Func.arity class attribute is added to :class:~django.db.models.Func. This attribute can be used to set the number of arguments the function accepts.

  • Added :class:~django.db.models.BigAutoField which acts much like an :class:~django.db.models.AutoField except that it is guaranteed to fit numbers from 1 to 9223372036854775807.

  • :meth:QuerySet.in_bulk() &lt;django.db.models.query.QuerySet.in_bulk&gt; may be called without any arguments to return all objects in the queryset.

  • :attr:~django.db.models.ForeignKey.related_query_name now supports app label and class interpolation using the &#39;%(app_label)s&#39; and &#39;%(class)s&#39; strings.

  • Allowed overriding model fields inherited from abstract base classes.

  • The :func:~django.db.models.prefetch_related_objects function is now a public API.

  • :meth:QuerySet.bulk_create() &lt;django.db.models.query.QuerySet.bulk_create&gt; sets the primary key on objects when using PostgreSQL.

  • Added the :class:~django.db.models.functions.Cast database function.

  • A proxy model may now inherit multiple proxy models that share a common non-abstract parent class.

  • Added :class:~django.db.models.functions.datetime.Extract functions to extract datetime components as integers, such as year and hour.

  • Added :class:~django.db.models.functions.datetime.Trunc functions to truncate a date or datetime to a significant component. They enable queries like sales-per-day or sales-per-hour.

  • Model.__init__() now sets values of virtual fields from its keyword arguments.

  • The new :attr:Meta.base_manager_name &lt;django.db.models.Options.base_manager_name&gt; and :attr:Meta.default_manager_name &lt;django.db.models.Options.default_manager_name&gt; options allow controlling the :attr:~django.db.models.Model._base_manager and :attr:~django.db.models.Model._default_manager, respectively.

Requests and Responses ~~~~~~~~~~~~~~~~~~~~~~

  • Added request.user to the debug view.

  • Added :class:~django.http.HttpResponse methods :meth:~django.http.HttpResponse.readable() and :meth:~django.http.HttpResponse.seekable() to make an instance a stream-like object and allow wrapping it with :py:class:io.TextIOWrapper.

  • Added the :attr:HttpResponse.content_type &lt;django.http.HttpRequest.content_type&gt; and :attr:~django.http.HttpRequest.content_params attributes which are parsed from the CONTENT_TYPE header.

  • The parser for request.COOKIES is simplified to better match the behavior of browsers. request.COOKIES may now contain cookies that are invalid according to :rfc:6265 but are possible to set via document.cookie.

Serialization ~~~~~~~~~~~~~

  • The django.core.serializers.json.DjangoJSONEncoder now knows how to serialize lazy strings, typically used for translatable content.

Templates ~~~~~~~~~

  • Added the autoescape option to the :class:~django.template.backends.django.DjangoTemplates backend and the :class:~django.template.Engine class.

  • Added the is and is not comparison operators to the :ttag:if tag.

  • Allowed :tfilter:dictsort to order a list of lists by an element at a specified index.

  • The :func:~django.template.context_processors.debug context processor contains queries for all database aliases instead of only the default alias.

  • Added relative path support for string arguments of the :ttag:extends and :ttag:include template tags.

Tests ~~~~~

  • To better catch bugs, :class:~django.test.TestCase now checks deferrable database constraints at the end of each test.

  • Tests and test cases can be :ref:marked with tags &lt;topics-tagging-tests&gt; and run selectively with the new :option:test --tag and :option:test --exclude-tag options.

  • You can now login and use sessions with the test client even if :mod:django.contrib.sessions is not in :setting:INSTALLED_APPS.

URLs ~~~~

  • An addition in :func:django.setup() allows URL resolving that happens outside of the request/response cycle (e.g. in management commands and standalone scripts) to take :setting:FORCE_SCRIPT_NAME into account when it is set.

Validators ~~~~~~~~~~

  • :class:~django.core.validators.URLValidator now limits the length of domain name labels to 63 characters and the total length of domain names to 253 characters per :rfc:1034.

  • :func:~django.core.validators.int_list_validator now accepts an optional allow_negative boolean parameter, defaulting to False, to allow negative integers.

.. _backwards-incompatible-1.10:

Backwards incompatible changes in 1.10

.. warning::

In addition to the changes outlined in this section, be sure to review the :ref:removed-features-1.10 for the features that have reached the end of their deprecation cycle and therefore been removed. If you haven't updated your code within the deprecation timeline for a given feature, its removal may appear as a backwards incompatible change.

Database backend API

  • GIS's AreaField uses an unspecified underlying numeric type that could in practice be any numeric Python type. decimal.Decimal values retrieved from the database are now converted to float to make it easier to combine them with values used by the GIS libraries.

  • In order to enable temporal subtraction you must set the supports_temporal_subtraction database feature flag to True and implement the DatabaseOperations.subtract_temporals() method. This method should return the SQL and parameters required to compute the difference in microseconds between the lhs and rhs arguments in the datatype used to store :class:~django.db.models.DurationField.

select_related() prohibits non-relational fields for nested relations

Django 1.8 added validation for non-relational fields in select_related()::

>>> Book.objects.select_related('title') Traceback (most recent call last): … FieldError: Non-relational field given in select_related: 'title'

But it didn't prohibit nested non-relation fields as it does now::

>>> Book.objects.select_related('author__name') Traceback (most recent call last): … FieldError: Non-relational field given in select_related: 'name'

_meta.get_fields() returns consistent reverse fields for proxy models

Before Django 1.10, the :meth:~django.db.models.options.Options.get_fields method returned different reverse fields when called on a proxy model compared to its proxied concrete class. This inconsistency was fixed by returning the full set of fields pointing to a concrete class or one of its proxies in both cases.

:attr:AbstractUser.username &lt;django.contrib.auth.models.User.username&gt; max_length increased to 150

A migration for :attr:django.contrib.auth.models.User.username is included. If you have a custom user model inheriting from AbstractUser, you'll need to generate and apply a database migration for your user model.

We considered an increase to 254 characters to more easily allow the use of email addresses (which are limited to 254 characters) as usernames but rejected it due to a MySQL limitation. When using the utf8mb4 encoding (recommended for proper Unicode support), MySQL can only create unique indexes with 191 characters by default. Therefore, if you need a longer length, please use a custom user model.

If you want to preserve the 30 character limit for usernames, use a custom form when creating a user or changing usernames::

from django.contrib.auth.forms import UserCreationForm

class MyUserCreationForm(UserCreationForm): username = forms.CharField( max_length=30, help_text='Required. 30 characters or fewer. Letters, digits and /./+/-/_ only.', )

If you wish to keep this restriction in the admin, set UserAdmin.add_form to use this form::

from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.contrib.auth.models import User

class UserAdmin(BaseUserAdmin): add_form = MyUserCreationForm

admin.site.unregister(User) admin.site.register(User, UserAdmin)

Dropped support for PostgreSQL 9.1

Upstream support for PostgreSQL 9.1 ends in September 2016. As a consequence, Django 1.10 sets PostgreSQL 9.2 as the minimum version it officially supports.

runserver output goes through logging

Request and response handling of the runserver command is sent to the :ref:django-server-logger logger instead of to sys.stderr. If you disable Django's logging configuration or override it with your own, you'll need to add the appropriate logging configuration if you want to see that output::

'formatters': { 'django.server': { '()': 'django.utils.log.ServerFormatter', 'format': '[%(server_time)s] %(message)s', } }, 'handlers': { 'django.server': { 'level': 'INFO', 'class': 'logging.StreamHandler', 'formatter': 'django.server', }, }, 'loggers': { 'django.server': { 'handlers': ['django.server'], 'level': 'INFO', 'propagate': False, } }

auth.CustomUser and auth.ExtensionUser test models were removed

Since the introduction of migrations for the contrib apps in Django 1.8, the tables of these custom user test models were not created anymore making them unusable in a testing context.

Apps registry is no longer auto-populated when unpickling models outside of Django

The apps registry is no longer auto-populated when unpickling models. This was added in Django 1.7.2 as an attempt to allow unpickling models outside of Django, such as in an RQ worker, without calling django.setup(), but it creates the possibility of a deadlock. To adapt your code in the case of RQ, you can provide your own worker script &lt;http://python-rq.org/docs/workers/&gt;_ that calls django.setup().

Removed null assignment check for non-null foreign key fields

In older versions, assigning None to a non-nullable ForeignKey or OneToOneField raised ValueError(&#39;Cannot assign None: &quot;model.field&quot; does not allow null values.&#39;). For consistency with other model fields which don't have a similar check, this check is removed.

Removed weak password hashers from the default PASSWORD_HASHERS setting

Django 0.90 stored passwords as unsalted MD5. Django 0.91 added support for salted SHA1 with automatic upgrade of passwords when a user logs in. Django 1.4 added PBKDF2 as the default password hasher.

If you have an old Django project with MD5 or SHA1 (even salted) encoded passwords, be aware that these can be cracked fairly easily with today's hardware. To make Django users acknowledge continued use of weak hashers, the following hashers are removed from the default :setting:PASSWORD_HASHERS setting::

'django.contrib.auth.hashers.SHA1PasswordHasher' 'django.contrib.auth.hashers.MD5PasswordHasher' 'django.contrib.auth.hashers.UnsaltedSHA1PasswordHasher' 'django.contrib.auth.hashers.UnsaltedMD5PasswordHasher' 'django.contrib.auth.hashers.CryptPasswordHasher'

Consider using a :ref:wrapped password hasher &lt;wrapping-password-hashers&gt; to strengthen the hashes in your database. If that's not feasible, add the :setting:PASSWORD_HASHERS setting to your project and add back any hashers that you need.

You can check if your database has any of the removed hashers like this::

from django.contrib.auth import get_user_model User = get_user_model()

Unsalted MD5/SHA1:

User.objects.filter(passwordstartswith='md5$$') User.objects.filter(passwordstartswith='sha1$$') Salted MD5/SHA1: User.objects.filter(passwordstartswith='md5$').exclude(passwordstartswith='md5$$') User.objects.filter(passwordstartswith='sha1$').exclude(passwordstartswith='sha1$$') Crypt hasher: User.objects.filter(password__startswith='crypt$$')

from django.db.models import CharField from django.db.models.functions import Length CharField.register_lookup(Length) Unsalted MD5 passwords might not have an 'md5$$' prefix: User.objects.filter(password__length=32)

Field.get_prep_lookup() and Field.get_db_prep_lookup() methods are removed

If you have a custom field that implements either of these methods, register a custom lookup for it. For example::

from django.db.models import Field from django.db.models.lookups import Exact

class MyField(Field): …

class MyFieldExact(Exact): def get_prep_lookup(self): do_custom_stuff_for_myfield ….

MyField.register_lookup(MyFieldExact)

:mod:django.contrib.gis

  • Support for SpatiaLite < 3.0 and GEOS < 3.3 is dropped.

  • The add_postgis_srs() backwards compatibility alias for django.contrib.gis.utils.add_srs_entry() is removed.

  • On Oracle/GIS, the :class:~django.contrib.gis.db.models.functions.Area aggregate function now returns a float instead of decimal.Decimal. (It's still wrapped in a measure of square meters.)

  • The default :class:~django.contrib.gis.geos.GEOSGeometry representation (WKT output) is trimmed by default. That is, instead of POINT (23.0000000000000000 5.5000000000000000), you'll get POINT (23 5.5).

Maximum size of a request body and the number of GET/POST parameters is limited

Two new settings help mitigate denial-of-service attacks via large requests:

  • :setting:DATA_UPLOAD_MAX_MEMORY_SIZE limits the size that a request body may be. File uploads don't count towards this limit.
  • :setting:DATA_UPLOAD_MAX_NUMBER_FIELDS limits the number of GET/POST parameters that are parsed.

Applications that receive unusually large form posts may need to tune these settings.

Miscellaneous

  • The repr() of a QuerySet is wrapped in &lt;QuerySet &gt; to disambiguate it from a plain list when debugging.

  • utils.version.get_version() returns :pep:440 compliant release candidate versions (e.g. '1.10rc1' instead of '1.10c1').

  • CSRF token values are now required to be strings of 64 alphanumerics; values of 32 alphanumerics, as set by older versions of Django by default, are automatically replaced by strings of 64 characters. Other values are considered invalid. This should only affect developers or users who replace these tokens.

  • The LOGOUT_URL setting is removed as Django hasn't made use of it since pre-1.0. If you use it in your project, you can add it to your project's settings. The default value was &#39;/accounts/logout/&#39;.

  • Objects with a close() method such as files and generators passed to :class:~django.http.HttpResponse are now closed immediately instead of when the WSGI server calls close() on the response.

  • A redundant transaction.atomic() call in QuerySet.update_or_create() is removed. This may affect query counts tested by TransactionTestCase.assertNumQueries().

  • Support for skip_validation in BaseCommand.execute(**options) is removed. Use skip_checks (added in Django 1.7) instead.

  • :djadmin:loaddata now raises a CommandError instead of showing a warning when the specified fixture file is not found.

  • Instead of directly accessing the LogEntry.change_message attribute, it's now better to call the LogEntry.get_change_message() method which will provide the message in the current language.

  • The default error views now raise TemplateDoesNotExist if a nonexistent template_name is specified.

  • The unused choices keyword argument of the Select and SelectMultiple widgets' render() method is removed. The choices argument of the render_options() method is also removed, making selected_choices the first argument.

  • Tests that violate deferrable database constraints will now error when run on a database that supports deferrable constraints.

  • Built-in management commands now use indexing of keys in options, e.g. options[&#39;verbosity&#39;], instead of options.get() and no longer perform any type coercion. This could be a problem if you're calling commands using Command.execute() (which bypasses the argument parser that sets a default value) instead of :func:~django.core.management.call_command. Instead of calling Command.execute(), pass the command object as the first argument to call_command().

  • :class:~django.contrib.auth.backends.ModelBackend and :class:~django.contrib.auth.backends.RemoteUserBackend now reject inactive users. This means that inactive users can't login and will be logged out if they are switched from is_active=True to False. If you need the previous behavior, use the new :class:~django.contrib.auth.backends.AllowAllUsersModelBackend or :class:~django.contrib.auth.backends.AllowAllUsersRemoteUserBackend in :setting:AUTHENTICATION_BACKENDS instead.

  • In light of the previous change, the test client's :meth:~django.test.Client.login() method no longer always rejects inactive users but instead delegates this decision to the authentication backend. :meth:~django.test.Client.force_login() also delegates the decision to the authentication backend, so if you're using the default backends, you need to use an active user.

  • :func:django.views.i18n.set_language may now return a 204 status code for AJAX requests.

  • The base_field attribute of :class:~django.contrib.postgres.fields.RangeField is now a type of field, not an instance of a field. If you have created a custom subclass of :class:~django.contrib.postgres.fields.RangeField, you should change the base_field attribute.

  • Middleware classes are now initialized when the server starts rather than during the first request.

  • If you override is_authenticated() or is_anonymous() in a custom user model, you must convert them to attributes or properties as described in :ref:the deprecation note &lt;user-is-auth-anon-deprecation&gt;.

  • When using :attr:ModelAdmin.save_as=True &lt;django.contrib.admin.ModelAdmin.save_as&gt;, the "Save as new" button now redirects to the change view for the new object instead of to the model's changelist. If you need the previous behavior, set the new :attr:ModelAdmin.save_as_continue &lt;django.contrib.admin.ModelAdmin.save_as_continue&gt; attribute to False.

  • Required form fields now have the required HTML attribute. Set the :attr:Form.use_required_attribute &lt;django.forms.Form.use_required_attribute&gt; attribute to False to disable it. You could also add the novalidate attribute to &lt;form&gt; if you don't want browser validation. To disable the required attribute on custom widgets, override the :meth:Widget.use_required_attribute() &lt;django.forms.Widget.use_required_attribute&gt; method.

  • The WSGI handler no longer removes content of responses from HEAD requests or responses with a status_code of 100-199, 204, or 304. Most Web servers already implement this behavior. Responses retrieved using the Django test client continue to have these "response fixes" applied.

  • Model.__init__() now receives django.db.models.DEFERRED as the value of deferred fields.

  • The Model._deferred attribute is removed as dynamic model classes when using QuerySet.defer() and only() is removed.

  • :meth:Storage.save() &lt;django.core.files.storage.Storage.save&gt; no longer replaces &#39;\&#39; with &#39;/&#39;. This behavior is moved to :class:~django.core.files.storage.FileSystemStorage since this is a storage specific implementation detail. Any Windows user with a custom storage implementation that relies on this behavior will need to implement it in the custom storage's save() method.

  • Private :class:~django.db.models.FileField methods get_directory_name() and get_filename() are no longer called (and are now deprecated) which is a backwards incompatible change for users overriding those methods on custom fields. To adapt such code, override FileField.generate_filename() or :meth:Storage.generate_filename() &lt;django.core.files.storage.Storage.generate_filename&gt; instead. It might be possible to use :attr:~django.db.models.FileField.upload_to also.

  • The subject of mail sent by AdminEmailHandler is no longer truncated at 989 characters. If you were counting on a limited length, truncate the subject yourself.

  • Private expressions django.db.models.expressions.Date and DateTime are removed. The new :class:~django.db.models.functions.datetime.Trunc expressions provide the same functionality.

  • The _base_manager and _default_manager attributes are removed from model instances. They remain accessible on the model class.

  • Accessing a deleted field on a model instance, e.g. after del obj.field, reloads the field's value instead of raising AttributeError.

  • If you subclass AbstractBaseUser and override clean(), be sure it calls super(). :meth:.AbstractBaseUser.normalize_username is called in a new :meth:.AbstractBaseUser.clean method.

  • Private API django.forms.models.model_to_dict() returns a queryset rather than a list of primary keys for ManyToManyField\s .

  • If django.contrib.staticfiles is installed, the :ttag:static template tag uses the staticfiles storage to construct the URL rather than simply joining the value with STATIC_ROOT. The new approach encodes the URL, which could be backwards-incompatible in cases such as including a fragment in a path, e.g. {% static &#39;img.svgfragment&#39; %}, since the `` is encoded as%23. To adapt, move the fragment outside the template tag: {% static 'img.svg' %}fragment``.

.. _deprecated-features-1.10:

Features deprecated in 1.10

Direct assignment to a reverse foreign key or many-to-many relation

Instead of assigning related objects using direct assignment::

>>> new_list = [obj1, obj2, obj3] >>> e.related_set = new_list

Use the :meth:~django.db.models.fields.related.RelatedManager.set method added in Django 1.9::

   &gt;&gt;&gt; e.related_set.set([obj1, obj2, obj3])

This prevents confusion about an assignment resulting in an implicit save.

Non-timezone-aware :class:~django.core.files.storage.Storage API

The old, non-timezone-aware methods accessed_time(), created_time(), and modified_time() are deprecated in favor of the new get_*_time() methods.

Third-party storage backends should implement the new methods and mark the old ones as deprecated. Until then, the new get_*_time() methods on the base :class:~django.core.files.storage.Storage class convert datetime\s from the old methods as required and emit a deprecation warning as they do so.

Third-party storage backends may retain the old methods as long as they wish to support earlier versions of Django.

:mod:django.contrib.gis

  • The get_srid() and set_srid() methods of :class:~django.contrib.gis.geos.GEOSGeometry are deprecated in favor of the :attr:~django.contrib.gis.geos.GEOSGeometry.srid property.

  • The get_x(), set_x(), get_y(), set_y(), get_z(), and set_z() methods of :class:~django.contrib.gis.geos.Point are deprecated in favor of the x, y, and z properties.

  • The get_coords() and set_coords() methods of :class:~django.contrib.gis.geos.Point are deprecated in favor of the tuple property.

  • The cascaded_union property of :class:~django.contrib.gis.geos.MultiPolygon is deprecated in favor of the :attr:~django.contrib.gis.geos.GEOSGeometry.unary_union property.

  • The django.contrib.gis.utils.precision_wkt() function is deprecated in favor of :class:~django.contrib.gis.geos.WKTWriter.

CommaSeparatedIntegerField model field

CommaSeparatedIntegerField is deprecated in favor of :class:~django.db.models.CharField with the :func:~django.core.validators.validate_comma_separated_integer_list validator::

from django.core.validators import validate_comma_separated_integer_list from django.db import models

class MyModel(models.Model): numbers = models.CharField(…, validators=[validate_comma_separated_integer_list])

If you're using Oracle, CharField uses a different database field type (NVARCHAR2) than CommaSeparatedIntegerField (VARCHAR2). Depending on your database settings, this might imply a different encoding, and thus a different length (in bytes) for the same contents. If your stored values are longer than the 4000 byte limit of NVARCHAR2, you should use TextField (NCLOB) instead. In this case, if you have any queries that group by the field (e.g. annotating the model with an aggregation or using distinct()) you'll need to change them (to defer the field).

Using a model name as a query lookup when default_related_name is set

Assume the following models::

from django.db import models

class Foo(models.Model): pass

class Bar(models.Model): foo = models.ForeignKey(Foo)

   class Meta:
       default_related_name = &#39;bars&#39;

In older versions, :attr:~django.db.models.Options.default_related_name couldn't be used as a query lookup. This is fixed and support for the old lookup name is deprecated. For example, since default_related_name is set in model Bar, instead of using the model name bar as the lookup::

>>> bar = Bar.objects.get(pk=1) >>> Foo.objects.get(bar=bar)

use the default_related_name bars::

>>> Foo.objects.get(bars=bar)

.. _search-lookup-replacement:

__search query lookup

The search lookup, which supports MySQL only and is extremely limited in features, is deprecated. Replace it with a custom lookup::

from django.db import models

class Search(models.Lookup): lookup_name = 'search'

   def as_mysql(self, compiler, connection):
       lhs, lhs_params = self.process_lhs(compiler, connection)
       rhs, rhs_params = self.process_rhs(compiler, connection)
       params = lhs_params + rhs_params
       return &#39;MATCH (%s) AGAINST (%s IN BOOLEAN MODE)&#39; % (lhs, rhs), params

models.CharField.register_lookup(Search) models.TextField.register_lookup(Search)

.. _user-is-auth-anon-deprecation:

Using User.is_authenticated() and User.is_anonymous() as methods

The is_authenticated() and is_anonymous() methods of :class:~django.contrib.auth.models.AbstractBaseUser and :class:~django.contrib.auth.models.AnonymousUser classes are now properties. They will still work as methods until Django 2.0, but all usage in Django now uses attribute access.

For example, if you use :class:~django.contrib.auth.middleware.AuthenticationMiddleware and want to know whether the user is currently logged-in you would use::

if request.user.is_authenticated: … Do something for logged-in users. else: … Do something for anonymous users.

instead of request.user.is_authenticated().

This change avoids accidental information leakage if you forget to call the method, e.g.::

if request.user.is_authenticated: return sensitive_information

If you override these methods in a custom user model, you must change them to properties or attributes.

Django uses a CallableBool object to allow these attributes to work as both a property and a method. Thus, until the deprecation period ends, you cannot compare these properties using the is operator. That is, the following won't work::

if request.user.is_authenticated is True: …

Custom manager classes available through prefetch_related must define a _apply_rel_filters() method

If you defined a custom manager class available through :meth:~django.db.models.query.QuerySet.prefetch_related you must make sure it defines a _apply_rel_filters() method.

This method must accept a :class:~django.db.models.query.QuerySet instance as its single argument and return a filtered version of the queryset for the model instance the manager is bound to.

The "escape" half of django.utils.safestring

The mark_for_escaping() function and the classes it uses: EscapeData, EscapeBytes, EscapeText, EscapeString, and EscapeUnicode are deprecated.

As a result, the "lazy" behavior of the escape filter (where it would always be applied as the last filter no matter where in the filter chain it appeared) is deprecated. The filter will change to immediately apply :func:~django.utils.html.conditional_escape in Django 2.0.

Manager.use_for_related_fields and inheritance changes

Manager.use_for_related_fields is deprecated in favor of setting :attr:Meta.base_manager_name &lt;django.db.models.Options.base_manager_name&gt; on the model.

Model Manager inheritance will follow MRO inheritance rules in Django 2.0, changing the current behavior where managers defined on non-abstract base classes aren't inherited by child classes. A deprecating warning with instructions on how to adapt your code is raised if you have any affected managers. You'll either redeclare a manager from an abstract model on the child class to override the manager from the concrete model, or you'll set the model's Meta.manager_inheritance_from_future=True option to opt-in to the new inheritance behavior.

During the deprecation period, use_for_related_fields will be honored and raise a warning, even if a base_manager_name is set. This allows third-party code to preserve legacy behavior while transitioning to the new API. The warning can be silenced by setting silence_use_for_related_fields_deprecation=True on the manager.

Miscellaneous

  • The makemigrations --exit option is deprecated in favor of the :option:makemigrations --check option.

  • django.utils.functional.allow_lazy() is deprecated in favor of the new :func:~django.utils.functional.keep_lazy function which can be used with a more natural decorator syntax.

  • The shell --plain option is deprecated in favor of -i python or --interface python.

  • Importing from the django.core.urlresolvers module is deprecated in favor of its new location, :mod:django.urls.

  • The template Context.has_key() method is deprecated in favor of in.

  • The private attribute virtual_fields of Model._meta is deprecated in favor of private_fields.

  • The private keyword arguments virtual_only in Field.contribute_to_class() and virtual in Model._meta.add_field() are deprecated in favor of private_only and private, respectively.

  • The javascript_catalog() and json_catalog() views are deprecated in favor of class-based views :class:~django.views.i18n.JavaScriptCatalog and :class:~django.views.i18n.JSONCatalog.

  • In multi-table inheritance, implicit promotion of a OneToOneField to a parent_link is deprecated. Add parent_link=True to such fields.

  • The private API Widget._format_value() is made public and renamed to :meth:~django.forms.Widget.format_value. The old name will work through a deprecation period.

  • Private FileField methods get_directory_name() and get_filename() are deprecated in favor of performing this work in :meth:Storage.generate_filename() &lt;django.core.files.storage.Storage.generate_filename&gt;).

  • Old-style middleware that uses settings.MIDDLEWARE_CLASSES are deprecated. :ref:Adapt old, custom middleware &lt;upgrading-middleware&gt; and use the new :setting:MIDDLEWARE setting.

.. _removed-features-1.10:

Features removed in 1.10

These features have reached the end of their deprecation cycle and are removed in Django 1.10. See :ref:deprecated-features-1.8 for details, including how to remove usage of these features.

  • Support for calling a SQLCompiler directly as an alias for calling its quote_name_unless_alias method is removed.

  • The cycle and firstof template tags are removed from the future template tag library.

  • django.conf.urls.patterns() is removed.

  • Support for the prefix argument to django.conf.urls.i18n.i18n_patterns() is removed.

  • SimpleTestCase.urls is removed.

  • Using an incorrect count of unpacked values in the for template tag raises an exception rather than failing silently.

  • The ability to :func:~django.urls.reverse URLs using a dotted Python path is removed.

  • The ability to use a dotted Python path for the LOGIN_URL and LOGIN_REDIRECT_URL settings is removed.

  • Support for optparse is dropped for custom management commands.

  • The class django.core.management.NoArgsCommand is removed.

  • django.core.context_processors module is removed.

  • django.db.models.sql.aggregates module is removed.

  • django.contrib.gis.db.models.sql.aggregates module is removed.

  • The following methods and properties of django.db.sql.query.Query are removed:

  • Properties: aggregates and aggregate_select

  • Methods: add_aggregate, set_aggregate_mask, and append_aggregate_mask.

  • django.template.resolve_variable is removed.

  • The following private APIs are removed from :class:django.db.models.options.Options (Model._meta):

  • get_field_by_name()

  • get_all_field_names()
  • get_fields_with_model()
  • get_concrete_fields_with_model()
  • get_m2m_with_model()
  • get_all_related_objects()
  • get_all_related_objects_with_model()
  • get_all_related_many_to_many_objects()
  • get_all_related_m2m_objects_with_model()

  • The error_message argument of django.forms.RegexField is removed.

  • The unordered_list filter no longer supports old style lists.

  • Support for string view arguments to url() is removed.

  • The backward compatible shim to rename django.forms.Form._has_changed() to has_changed() is removed.

  • The removetags template filter is removed.

  • The remove_tags() and strip_entities() functions in django.utils.html is removed.

  • The is_admin_site argument to django.contrib.auth.views.password_reset() is removed.

  • django.db.models.field.subclassing.SubfieldBase is removed.

  • django.utils.checksums is removed.

  • The original_content_type_id attribute on django.contrib.admin.helpers.InlineAdminForm is removed.

  • The backwards compatibility shim to allow FormMixin.get_form() to be defined with no default value for its form_class argument is removed.

  • The following settings are removed, and

Updated 24/03/2017 16:07

Election result category

okfn/opendatasurvey

@dannylammerhirt - what is the status there? I see that countries that were closed last year (i.e UK or Canada) are now getting full scores of open. What was the decision there?

Updated 27/03/2017 07:16 2 Comments

Commercetools/refactor tests

commercetools/commercetools-sunrise-java-cms

@lauraluiz please, review

30

I analyzed the possibility to re-create it space on Contentful but it’d take too much time and IMO would not serve its purpose. I decided to remove it test and create unit test for service and more tests for contentful cms page. I think IT test is not needed as I added very strict tests for every line of code which proved to be correct. To efficiently mock Contentful sdk I had to make Callback class package-private. Unfortunately Contentful sdk is not written well enough to be easily mocked otherwise.

Updated 24/03/2017 14:20

two issues in arm_conv* files

ARM-software/CMSIS_5

Hi: There are seems have two issues in some arm_conv* files.

first one is the comments,

for example, at line 263 in arm_conv_f32: https://github.com/ARM-software/CMSIS_5/blob/develop/CMSIS/DSP/Source/FilteringFunctions/arm_conv_f32.c#L263

x[srcALen-srcBLen-2] should be x[srcALen-srcBLen] , because stage2 have (srcALen - (srcBLen - 1u)) items. so, this comment line should be: “sum = =x[srcALen-srcBLen] * y[srcBLen-1] + x[srcALen-srcBLen+1] * y[srcBLen-2] +…+ x[srcALen-1] * y[0]”

Second is also about index, but is in code. for example, at line 297 in arm_conv_f32: https://github.com/ARM-software/CMSIS_5/blob/develop/CMSIS/DSP/Source/FilteringFunctions/arm_conv_f32.c#L297

x0 = *(px++); should be x0 = *px++;

We should calculate convolution beginning at index 0, not 1. or we would got some errors

and here is my simple test case for this issue: https://gist.github.com/xizhizhang/342841f7614c2906d9ee241bc72e3f5e

I copied arm_conv_f32’s simply implementation, and renamed it as arm_conv_f32_simple in above case. I think it is a convenient and intuitive case that shows arm_conv_f32 have a error.

Thanks.

Updated 27/03/2017 07:52 2 Comments

Automated BZ1410939

SatelliteQE/robottelo

https://bugzilla.redhat.com/show_bug.cgi?id=1410939

py.test -v tests/foreman/ui/test_docker.py -k test_positive_create_with_disabled_sync_plan
=================================================== test session starts ====================================================
platform darwin -- Python 2.7.13, pytest-3.0.7, py-1.4.33, pluggy-0.4.0 -- /Users/andrii/workspace/env/bin/python
cachedir: .cache
rootdir: /Users/andrii/workspace/robottelo, inifile:


Automated BZ1410939
plugins: xdist-1.15.0, services-1.1.14, cov-2.4.0
collected 45 items
2017-03-24 14:36:49 - conftest - DEBUG - Found WONTFIX in decorated tests ['1269196', '1378009', '1245334', '1221971', '1217635', '1226425', '1156555', '1199150', '1204686', '1267224', '1103157', '1230902', '1214312', '1079482']

2017-03-24 14:36:49 - conftest - DEBUG - Collected 45 test cases


tests/foreman/ui/test_docker.py::DockerRepositoryTestCase::test_positive_create_with_disabled_sync_plan <- robottelo/decorators/__init__.py PASSED

=================================================== 44 tests deselected ====================================================
========================================= 1 passed, 44 deselected in 52.85 seconds =========================================
Updated 27/03/2017 07:13 2 Comments

I expect that I get print results after selecting a print option

Tangerine-Community/Tangerine

Expected behavior

After clicking any of the options on the P - print icon I expect to see some results.

Actual behavior

All actions except for the Cancel action fail with the message from the screenshot

Steps to reproduce the behavior

  1. Login as any user with access to printing action
  2. Click the P icon next to the assessment
  3. Select for example, Metadata 4 Note there are no results displayed

<img width=“422” alt=“screen shot 2017-03-24 at 1 28 24 pm” src=“https://cloud.githubusercontent.com/assets/453000/24294254/0cb8d986-1096-11e7-84b5-3ac5efcb7abb.png”>

Updated 24/03/2017 14:50

When I generate APK I expect to see Assessments tab

Tangerine-Community/Tangerine

Expected behavior

Assessment tab is shown for V2 apks for new groups

Actual behavior

Instead of an assessment tab there is a Schools tab

Steps to reproduce the behavior

  1. On v2.0.0rc9 create a new group
  2. Generate apk and install it
  3. Run the app and notice how the Assessment tab is missing

The tabs field includes a line for Schools but not for Assessment. Changing this manually with the below doc works

[
   {
       "url": "#workflows",
       "views": [
           {
               "className": "WorkflowMenuViewController"
           }
       ],
       "weight": 1,
       "title": "Workflows"
   },
   {
       "url": "#bandwidth",
       "views": [
           {
               "className": "BandwidthCheckView"
           },
           {
               "className": "UniversalUploadView"
           },
           {
               "className": "ResultsSaveAsFileView"
           }
       ],
       "weight": 2,
       "title": "Sync"
   },
     {
       "url": "#Assessments",
       "views": [
           {
               "className": "AssessmentsViewController"
           }
       ],
       "weight": 3,
       "title": "Assessments"
   },
]
Updated 24/03/2017 14:50

[WIP] Orders Pagination

reactioncommerce/reaction

Fixes #1921

How To Test

  1. Make a couple of orders (10 or so)
  2. Go to the Orders tab in the dashboard
  3. Observe that the number of orders being displayed is less than what the count at the tabs is
  4. Chick Show More and observe the rest of the orders being loaded.

Still trying to refine the implementation. Suggestions are welcome.

Updated 24/03/2017 13:31

I expect to see manager role after running v2.0.0.sh

Tangerine-Community/Tangerine

Expected behavior

Manager role to show up in user db for user1

Actual behavior

Manager role does not show up in user database

Steps to reproduce the behavior

  1. Create a group under v0 or v1
  2. Upgrade to v2
  3. run: docker exec -it tangerine-container /tangerine-server/upgrades/v2.0.0.sh
The output of the command is:
running helper script v2.0.0-helper.js


Robbert missing environment variables. Defaults used:

T_LOG_LEVEL=info                Detail of logs.

How the Access Control list works has changed. Add manager role to necessary users and overrwrite the acl document in the tangerine databas
e.

No users are given the manager role. I think that line 70 in helper.js is wrong: process.env.T_ADMIN. Shouldn’t this be T_USER1? I changed it to user 1 but still the script doesn’t enter anything after: if (!dbAclDoc.hasOwnProperty(‘groups’)) return resolve()

Updated 24/03/2017 14:50

Cluster stats should not render empty http/transport types

elastic/elasticsearch

This commit changes ClusterStatsNodes.NetworkTypes so that is does not print out empty field names when no Transport or HTTP type is defined:

{
      ...
      "network_types": {
        ...
        "http_types": {
          "": 2
        }
      }
}

is now rendered as:

{
      ...
      "network_types": {
        ...
        "http_types": {
        }
      }
}

This should almost never happen because transport-netty4 is shipped by default, but we can have integration tests that use mocked transport plugins without registering HTTP transport types.

Updated 27/03/2017 11:01

only check for url overflows when not hashing states

elastic/kibana

Fixes #10129

The url-overflow check ensures that the URL length doesn’t get out of control and tries to warn users to use state hashing if the url is growing too long. Right now we still check the url length when the user has turned on state hashing, and since links to different states still use the unhashed state (so opening in a new tab still works, for instance) those urls trip the url-overflow check and cause Kibana to redirect to the url-overflow error page.

To prevent this I’ve added a check to the url-overflow check that ensures that state hashing is turned off before checking.

To reproduce this in master: 1. create a massive dashboard in chrome 1. try to open that dashboard in any IE/Edge 1. see the error 1. turn on state:storeInSessionStorage advanced config 1. visit the dashboard again and see the same error

In this PR the final step will actually render the dashboard.

Updated 24/03/2017 01:31

"Deny when out of stock" behavior improvements 1928

reactioncommerce/reaction

Resolves #1928

Description Part 1

If I have 5 in stock and I add 10 of something to my cart my quantity is reduced to 5 (which makes sense) but I don’t receive any sort of alert that my quantity has been changed and the “Added to Cart” alert shows the original quantity, not the adjusted quantity. This could lead to user confusion. I feel like at one time there was an alert that said “Your quantity has been adjusted”.

Test Steps 1. Set product variant quantity to 5 2. Add 10 products of the variant onto cart 3. Expect an alert showing that the original quantity has been adjusted.

Description Part 2

If I have 5 in stock and I add 10 to my cart my quantity is reduced to 5. If I add another 20, the total quantity is now 10. So the “Deny when out of stock” is only the affecting the quantity I can add to cart, not the quantity in my cart. So I could have 10 in my cart even though there are only 5 in-stock, which I would think is exactly what “Deny when out of stock” is trying to avoid.

Test Steps 1. Set product variant quantity to 5 2. Add 10 products of the variant onto cart 3. Expect that quantity has been reduced to 5 (An alert pops up for the adjustment) 4. Add another 10 products onto cart 5. Expect an error alert stating that your cart is full

Updated 24/03/2017 12:51 2 Comments

deposit: video upload improvement

CERNDocumentServer/cds
  • Sets a video’s title to its basename (i.e. filename without extension) on upload, in order for the user to be able to identify individual uploads. (closes #561)

  • On completion of the ExtractMetadataTask, a video’s default title gets overwritten with the one inside the extracted metadata, if it exists. (closes #425)

  • Fixes issue with prefilled copyright.year being an integer, instead of a string.

  • Adds mov to the default video extensions.

  • Adds extracted_metadata inside the payload of the on_success SSE of the ExtractMetadataTask, in order to prefill desired information immediately without having to wait for an update_deposit SSE.

Signed-off-by: Orestis Melkonian melkon.or@gmail.com

Updated 27/03/2017 07:15

Take into account MARC relators "art" and "cmp"

hbz/lobid-resources

art (“Künstler/in”, example http://lobid.org/resources/HT018782520) and cmp (“Komposition”, example http://lobid.org/resources/HT018782520) aren’t taken into account in the transformation yet. (Originated at https://github.com/hbz/lobid-resources/issues/72#issuecomment-288680688.)

Updated 24/03/2017 15:16 4 Comments

[REVIEW]: Ensight4Matlab: read, process, and write data in EnSight Gold format from C++ or MATLAB

openjournals/joss-reviews

Submitting author: schmeisser (<a href=“http://orcid.org/0000-0002-4400-9635”>Andre Schmeißer</a>) Repository: <a href=“https://github.com/ITWM-TVFS/Ensight4Matlab” target =“_blank”>https://github.com/ITWM-TVFS/Ensight4Matlab</a> Version: v1.0 Editor: @cmadan Reviewer: @Kevin-Mattheus-Moerman Archive: Pending

Status

status

Status badge code:

HTML: <a href="http://joss.theoj.org/papers/63e2a265afe07dff7564dfacb6086a72"><img src="http://joss.theoj.org/papers/63e2a265afe07dff7564dfacb6086a72/status.svg"></a>
Markdown: [![status](http://joss.theoj.org/papers/63e2a265afe07dff7564dfacb6086a72/status.svg)](http://joss.theoj.org/papers/63e2a265afe07dff7564dfacb6086a72)

Reviewers and authors:

Please avoid lengthy details of difficulties in the review thread. Instead, please create a new issue in the <a href=“https://github.com/ITWM-TVFS/Ensight4Matlab” target=“_blank”>target repository</a> and link to those issues (especially acceptance-blockers) in the review thread below. (For completists: if the target issue tracker is also on GitHub, linking the review thread in the issue or vice versa will create corresponding breadcrumb trails in the link target.)

Reviewer questions

Conflict of interest

  • [x] As the reviewer I confirm that there are no conflicts of interest for me to review this work (such as being a major contributor to the software).

General checks

  • [x] Repository: Is the source code for this software available at the <a target=“_blank” href=“https://github.com/ITWM-TVFS/Ensight4Matlab”>repository url</a>?
  • [x] License: Does the repository contain a plain-text LICENSE file with the contents of an OSI approved software license?
  • [ ] Version: Does the release version given match the GitHub release (v1.0)?
  • [x] Authorship: Has the submitting author (schmeisser) made major contributions to the software?

Functionality

  • [ ] Installation: Does installation proceed as outlined in the documentation?
  • [ ] Functionality: Have the functional claims of the software been confirmed?
  • [ ] Performance: Have any performance claims of the software been confirmed?

Documentation

  • [ ] A statement of need: Do the authors clearly state what problems the software is designed to solve and who the target audience is?
  • [ ] Installation instructions: Is there a clearly-stated list of dependencies? Ideally these should be handled with an automated package management solution.
  • [ ] Example usage: Do the authors include examples of how to use the software (ideally to solve real-world analysis problems).
  • [ ] Functionality documentation: Is the core functionality of the software documented to a satisfactory level (e.g. API method documentation)?
  • [ ] Automated tests: Are there automated tests or manual steps described so that the function of the software can be verified?
  • [ ] Community guidelines: Are there clear guidelines for third parties wishing to 1) Contribute to the software 2) Report issues or problems with the software 3) Seek support

Software paper

  • [ ] Authors: Does the paper.md file include a list of authors with their affiliations?
  • [ ] A statement of need: Do the authors clearly state what problems the software is designed to solve and who the target audience is?
  • [ ] References: Do all archival references that should have a DOI list one (e.g. papers, datasets, software)?
Updated 23/03/2017 16:28 3 Comments

[WIP] 2014 Change Delete Product Tooltip To Archive Product

reactioncommerce/reaction

Resolves

2014

Manual Test - Login as admin - Click on a product - Hover for 3 seconds on the archive icon on the selected panel header by the right part of your screen - The tooltip should show Archive product. - Also, click on the product to view the details. - Click the pencil icon on a variant to view the details. - On the panel header you would see an archive icon, with a tooltip saying Archive Variant - You can also click a variant option to view its details. - Below the edit form, you would see an archive icon with a tooltip saying Archive Option

Updated 23/03/2017 10:42 2 Comments

[optimizer] Use relative paths instead of absolute publicPath

elastic/kibana

Currently, when creating bundles with webpack we use absolute urls to locate static assets in stylesheets. When the base path changes, these bundles have to be regenerated. This forces an optimization step, which short term takes time, and long term gets in the way of us not shipping webpack.

This switches to using relative paths for assets.

An example in optimize/kibana.style.css, before: .panel-product .panel-heading-elasticsearch { background-image: url(/my_base_path/bundles/6a80accb153b8f8177a67951b7fc4cc2.svg); } After: .panel-product .panel-heading-elasticsearch { background-image: url(6a80accb153b8f8177a67951b7fc4cc2.svg); }

Closes #10724

Updated 24/03/2017 17:25 5 Comments

WIP: Basic version of the multiplevisualizer base class

DistrictDataLabs/yellowbrick

Work in progress - just adding this as a pull request so we can discuss at the sprint planning meeting whether this conceptual approach fits with how we might make various types of multi-plot visualizers in the future (small multiples or dashboards).

Issues to resolve: - Should this be a mixin? - Can we expect to be able to set the ax of a visualizer using vizualizer.ax after init in all cases?

Future work: Need to extend various features so it performs as expected. Examples: mXn subplots not handled correctly, fewer visualizers in self.visualizers than subplot spaces available (e.g. 2x2 grid with only 3 visualizers), smart handling of labels based on sharex/sharey or not.

Updated 22/03/2017 23:49 2 Comments

[6.2.z]implement shared function

SatelliteQE/robottelo

close issue: https://github.com/SatelliteQE/robottelo/issues/4442

Shared function is a decorator, that enable a function once called to store the results to storage, any ulterior call from the same or other processes will return the stored results, which make the shared function results persistent.

Note: Shared function store it’s data as json. The results of the decorated function must be json compatible.

Usage::

    from robottelo.decorators.func_shared.shared import shared

    @shared
    def module_level_shared(*args, **kwargs):
        # do some
        # the result of a shared function must be json compatible
        return any_data

    class SomeTestCase1(TestCase):

        @shared
        def _shared_function(cls):

            org = make_org()
            # upload manifest
            repo = make_repository()
            return {'org_id': org['id'], 'repo_id': repo['id']}

        @classmethod
        @shared
        def setUpClass(cls):

            data = cls._shared_function()
            other_data = module_level_shared()

            cls.org = Org.info({'id': data['org_id']})
            cls.repo = Repository.info({'id': data['repo_id']})
            return

    # the shared function can be called an other time to be able to initiate
    # specific data

    class SomeTestCase2(TestCase):

        @classmethod
        @shared(inject=True, injected_kw='_injected')
        def setUpClass(cls, org_id=None, repo_id=None, _injected=False):

            if _injected:
                cls.org = Org.info({'id': org_id})
                cls.repo = Repository.info({'id': repo_id})
            else:
                # create the org
                cls.org = make_org()
                # upload manifest
                cls.repo = make_repository()

            # create a virtual machine

            # shared function with injected=True, must return a dict
            # the resulting dictionary will be injected in other calls as
            # kwargs, an added bool kw argument by default named _injected
            # should be added to the function kwargs, to be able to be notified
            # that the kwargs are injected from already stored result
            return {'org_id': cls.org['id'], 'repo_id': cls.repo['id']}

        # in case we do not want the injected key word in kwargs
        # simply , declare injected_kw=None
        @classmethod
        @shared(inject=True, injected_kw=None)
        def shared_class_method(cls, org_id=None, repo_id=None):
             if org_id is not None:
                cls.org = Org.info({'id': org_id})
             else:
                # create the org
                cls.org = make_org()
                # upload manifest
             if repo_id is not None:
                cls.repo = Repository.info({'id': repo_id})
             else:
                cls.repo = make_repository()

            # create a virtual machine

            return {'org_id': cls.org['id'], 'repo_id': cls.repo['id']}

Features :

  • main functionality unittest covered
  • supported storage: file or redis
  • restored failures
  • retry call (in case of first call failed) can be configured, by default retries=2
  • stored data timeout (by default 24 hours)
  • when using file storage, cmd: “make clean-shared” to clean the temp storage files
  • can share function results at module level , classes up to second level
  • the shared results can be shared between processes and with redis usage between processes running on different hosts.

Example usage: 1- we have a capsule setup, but to create the capsule org with it’s content views that contain the needed rh products needed by the capsule to install, it takes many time, we can create a shared setup_capsule_org function that will be used by the setup_capsule if no org indicated, that way all the capsule tests will use the same capsule org (as the capsule org content is created when first called). 2- any setUpClass that need to share data with all the tests processes. 3- We can now use shared setUpClass with publish manifest without run in one thread decorator (but need’s the locking of the manifest upload).

Note: the result of shared function is shared also between all tiers, if they are started before the result timeout .

Inconvenient: * We can share only the data that are json persistent for the moment CLI info results can be shared directly as they are dictionaries, nailgun entities needs some work to be done, but enties can be passed by ids and restored for example:

  cls.org = Org.info({'id': org_id}) 

  or 

  entities.Organization(id=org_id).read()

for the moment if any key value return by a shared function is an entity , the the saved value will be value.to_json_dict() (look at api testcase on how nailgun entities are restored)

Example test done: cli.test.host.HostCreateTestCase Note test is not included in this PR as think that PR must be merged alone tests done with 8 processes ```python class HostCreateTestCase(CLITestCase): “”“Tests for creating the hosts via CLI.”“”

@classmethod
@shared(inject=True)
def setUpClass(cls, new_org=None, puppet_cv=None, puppet_env=None,
               puppet_class=None, _injected=False):
    """Create organization, lifecycle environment, content view, publish
    and promote new version to re-use in tests.
    """
    super(HostCreateTestCase, cls).setUpClass()

    if _injected:
        cls.new_org = new_org
        cls.puppet_cv = puppet_cv
        cls.puppet_env = puppet_env
        cls.puppet_class = puppet_class
    else:
        cls.new_org = make_org()
        # Setup for puppet class related tests
        puppet_modules = [
            {'author': 'robottelo', 'name': 'generic_1'},
        ]
        cls.puppet_cv = publish_puppet_module(
            puppet_modules, CUSTOM_PUPPET_REPO, cls.new_org['id'])
        cls.puppet_env = Environment.list({
            'search': u'content_view="{0}"'.format(
                cls.puppet_cv['name'])})[0]
        cls.puppet_class = Puppet.info({
            'name': puppet_modules[0]['name'],
            'environment': cls.puppet_env['name'],
        })
    return dict(new_org=cls.new_org, puppet_cv=cls.puppet_cv,
                puppet_env=cls.puppet_env, puppet_class=cls.puppet_class)
The stored shared data file:
http://pastebin.test.redhat.com/468164 

test run with sat-6.2.8-4.1b as the latest version seems to fail on that tests.

test log:

(sat-6.2.z) dlezz@elysion:~/projects/robottelo-fork$ py.test tests/foreman/cli/test_host.py -n 8 -v -k “HostCreateTestCase” ================================================= test session starts ================================================== platform linux2 – Python 2.7.13, pytest-2.9.2, py-1.4.32, pluggy-0.3.1 – /home/dlezz/.pyenv/versions/sat-6.2.z/bin/python cachedir: .cache rootdir: /home/dlezz/projects/robottelo-fork, inifile: plugins: xdist-1.15.0, services-1.1.14, cov-2.3.1 [gw0] linux2 Python 2.7.13 cwd: /home/dlezz/projects/robottelo-fork [gw1] linux2 Python 2.7.13 cwd: /home/dlezz/projects/robottelo-fork [gw2] linux2 Python 2.7.13 cwd: /home/dlezz/projects/robottelo-fork [gw3] linux2 Python 2.7.13 cwd: /home/dlezz/projects/robottelo-fork [gw4] linux2 Python 2.7.13 cwd: /home/dlezz/projects/robottelo-fork [gw5] linux2 Python 2.7.13 cwd: /home/dlezz/projects/robottelo-fork [gw6] linux2 Python 2.7.13 cwd: /home/dlezz/projects/robottelo-fork [gw7] linux2 Python 2.7.13 cwd: /home/dlezz/projects/robottelo-fork [gw6] Python 2.7.13 (default, Feb 1 2017, 15:29:46) – [GCC 4.8.4] [gw2] Python 2.7.13 (default, Feb 1 2017, 15:29:46) – [GCC 4.8.4] [gw0] Python 2.7.13 (default, Feb 1 2017, 15:29:46) – [GCC 4.8.4] [gw1] Python 2.7.13 (default, Feb 1 2017, 15:29:46) – [GCC 4.8.4] [gw4] Python 2.7.13 (default, Feb 1 2017, 15:29:46) – [GCC 4.8.4] [gw3] Python 2.7.13 (default, Feb 1 2017, 15:29:46) – [GCC 4.8.4] [gw7] Python 2.7.13 (default, Feb 1 2017, 15:29:46) – [GCC 4.8.4] [gw5] Python 2.7.13 (default, Feb 1 2017, 15:29:46) – [GCC 4.8.4] gw0 [6] / gw1 [6] / gw2 [6] / gw3 [6] / gw4 [6] / gw5 [6] / gw6 [6] / gw7 [6] scheduling tests via LoadScheduling

tests/foreman/cli/test_host.py::HostCreateTestCase::test_positive_list_smartvariables_by_id <- robottelo/decorators/init.py tests/foreman/cli/test_host.py::HostCreateTestCase::test_positive_create_with_name tests/foreman/cli/test_host.py::HostCreateTestCase::test_positive_create_using_libvirt_without_mac <- robottelo/decorators/init.py tests/foreman/cli/test_host.py::HostCreateTestCase::test_positive_list_scparams_by_id <- robottelo/decorators/init.py tests/foreman/cli/test_host.py::HostCreateTestCase::test_positive_list_smartvariables_by_name <- robottelo/decorators/init.py tests/foreman/cli/test_host.py::HostCreateTestCase::test_positive_list_scparams_by_name <- robottelo/decorators/init.py [gw7] SKIPPED tests/foreman/cli/test_host.py::HostCreateTestCase::test_positive_create_using_libvirt_without_mac <- robottelo/decorators/init.py [gw0] PASSED tests/foreman/cli/test_host.py::HostCreateTestCase::test_positive_list_smartvariables_by_id <- robottelo/decorators/init.py [gw2] PASSED tests/foreman/cli/test_host.py::HostCreateTestCase::test_positive_list_scparams_by_name <- robottelo/decorators/init.py [gw6] PASSED tests/foreman/cli/test_host.py::HostCreateTestCase::test_positive_list_smartvariables_by_name <- robottelo/decorators/init.py [gw4] PASSED tests/foreman/cli/test_host.py::HostCreateTestCase::test_positive_list_scparams_by_id <- robottelo/decorators/init.py [gw3] PASSED tests/foreman/cli/test_host.py::HostCreateTestCase::test_positive_create_with_name

======================================== 5 passed, 1 skipped in 172.87 seconds ========================================= ``` without the shared function the same tests have results: 5 passed, 1 skipped in 500.40 seconds if we count only the time gain using shared : 65%


test api.test_host.HostTestCase

class HostTestCase(APITestCase):
    """Tests for ``entities.Host().path()``."""

    @classmethod
    @shared(inject=True)
    def setUpClass(cls, org_id=None, loc_id=None, cv_id=None, env_id=None,
                   lce_id=None, puppet_classes=None, image_id=None,
                   compresource_libvirt_id=None, _injected=False):
        """Setup common entities."""
        super(HostTestCase, cls).setUpClass()
        if _injected:
            cls.org = entities.Organization(id=org_id).read()
            cls.loc = entities.Location(id=loc_id).read()
            cls.cv = entities.ContentView(id=cv_id).read()
            cls.env = entities.Environment(id=env_id).read()
            cls.lce = entities.LifecycleEnvironment(id=lce_id).read()
            cls.puppet_classes = [entities.PuppetClass(id=cp_id) .read()
                                  for cp_id in puppet_classes]
            cls.compresource_libvirt = entities.LibvirtComputeResource(
                id=compresource_libvirt_id).read()
            cls.image = entities.Image(
                id=image_id, compute_resource=cls.compresource_libvirt).read()
        else:
            cls.org = entities.Organization().create()
            cls.loc = entities.Location(organization=[cls.org]).create()
            # Content View and repository related entities
            cls.cv = publish_puppet_module(
                [{'author': 'robottelo', 'name': 'generic_1'}],
                CUSTOM_PUPPET_REPO,
                organization_id=cls.org.id
            )
            cls.env = entities.Environment().search(
                query={'search': u'content_view="{0}"'.format(cls.cv.name)}
            )[0].read()
            cls.lce = entities.LifecycleEnvironment(
                organization=cls.org.id).search(query={
                    'search': 'name={0} and organization_id={1}'.format(
                        ENVIRONMENT, cls.org.id)
                }
            )[0].read()
            cls.puppet_classes = entities.PuppetClass().search(query={
                'search': u'name ~ "{0}" and environment = "{1}"'.format(
                    'generic_1', cls.env.name)
            })
            # Compute Resource related entities
            cls.compresource_libvirt = entities.LibvirtComputeResource(
                organization=[cls.org],
                location=[cls.loc],
            ).create()
            cls.image = entities.Image(
                compute_resource=cls.compresource_libvirt).create()
        puppet_classes = [pc.id for pc in cls.puppet_classes]
        return dict(org_id=cls.org.id, loc_id=cls.loc.id, cv_id=cls.cv.id,
                    env_id=cls.env.id, lce_id=cls.lce.id,
                    puppet_classes=puppet_classes,
                    compresource_libvirt_id=cls.compresource_libvirt.id,
                    image_id=cls.image.id)

test logs:

(sat-6.2.z) dlezz@elysion:~/projects/robottelo-fork$ py.test tests/foreman/api/test_host.py -n 8 -v -k "HostTestCase"
================================================= test session starts ==================================================
platform linux2 -- Python 2.7.13, pytest-2.9.2, py-1.4.32, pluggy-0.3.1 -- /home/dlezz/.pyenv/versions/sat-6.2.z/bin/python
cachedir: .cache
rootdir: /home/dlezz/projects/robottelo-fork, inifile: 
plugins: xdist-1.15.0, services-1.1.14, cov-2.3.1
[gw0] linux2 Python 2.7.13 cwd: /home/dlezz/projects/robottelo-fork
[gw1] linux2 Python 2.7.13 cwd: /home/dlezz/projects/robottelo-fork
[gw2] linux2 Python 2.7.13 cwd: /home/dlezz/projects/robottelo-fork
[gw3] linux2 Python 2.7.13 cwd: /home/dlezz/projects/robottelo-fork
[gw4] linux2 Python 2.7.13 cwd: /home/dlezz/projects/robottelo-fork
[gw5] linux2 Python 2.7.13 cwd: /home/dlezz/projects/robottelo-fork
[gw6] linux2 Python 2.7.13 cwd: /home/dlezz/projects/robottelo-fork
[gw7] linux2 Python 2.7.13 cwd: /home/dlezz/projects/robottelo-fork
[gw4] Python 2.7.13 (default, Feb  1 2017, 15:29:46)  -- [GCC 4.8.4]
[gw6] Python 2.7.13 (default, Feb  1 2017, 15:29:46)  -- [GCC 4.8.4]
[gw1] Python 2.7.13 (default, Feb  1 2017, 15:29:46)  -- [GCC 4.8.4]
[gw5] Python 2.7.13 (default, Feb  1 2017, 15:29:46)  -- [GCC 4.8.4]  
[gw7] Python 2.7.13 (default, Feb  1 2017, 15:29:46)  -- [GCC 4.8.4]   
[gw3] Python 2.7.13 (default, Feb  1 2017, 15:29:46)  -- [GCC 4.8.4]    
[gw0] Python 2.7.13 (default, Feb  1 2017, 15:29:46)  -- [GCC 4.8.4]     
[gw2] Python 2.7.13 (default, Feb  1 2017, 15:29:46)  -- [GCC 4.8.4]      
gw0 [57] / gw1 [57] / gw2 [57] / gw3 [57] / gw4 [57] / gw5 [57] / gw6 [57] / gw7 [57]
scheduling tests via LoadScheduling

tests/foreman/api/test_host.py::HostTestCase::test_negative_update_os <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_comment <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_inherit_lce_cv <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_negative_update_arch <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_negative_update_mac <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_build_parameter <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_compresource <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_negative_update_name <- robottelo/decorators/__init__.py ^[^[
[gw6] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_build_parameter <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_image <- robottelo/decorators/__init__.py 
[gw5] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_inherit_lce_cv <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_hostgroup <- robottelo/decorators/__init__.py 
[gw4] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_compresource <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_managed_parameter <- robottelo/decorators/__init__.py 
[gw1] PASSED tests/foreman/api/test_host.py::HostTestCase::test_negative_update_os <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_host_parameters <- robottelo/decorators/__init__.py 
[gw7] PASSED tests/foreman/api/test_host.py::HostTestCase::test_negative_update_arch <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_compute_profile <- robottelo/decorators/__init__.py 
[gw6] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_image <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_model <- robottelo/decorators/__init__.py 
[gw1] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_host_parameters <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_provision_method <- robottelo/decorators/__init__.py 
[gw4] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_managed_parameter <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_owner_type <- robottelo/decorators/__init__.py 
[gw5] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_hostgroup <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_name <- robottelo/decorators/__init__.py 
[gw2] PASSED tests/foreman/api/test_host.py::HostTestCase::test_negative_update_mac <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_content_view <- robottelo/decorators/__init__.py 
[gw7] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_compute_profile <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_puppet_ca_proxy <- robottelo/decorators/__init__.py 
[gw6] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_model <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_puppet_class <- robottelo/decorators/__init__.py 
[gw0] PASSED tests/foreman/api/test_host.py::HostTestCase::test_negative_update_name <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_enabled_parameter <- robottelo/decorators/__init__.py 
[gw2] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_content_view <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_usergroup <- robottelo/decorators/__init__.py 
[gw1] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_provision_method <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_puppet_proxy <- robottelo/decorators/__init__.py 
[gw6] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_puppet_class <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_get_per_page <- robottelo/decorators/__init__.py 
[gw4] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_owner_type <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_subnet <- robottelo/decorators/__init__.py 
[gw7] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_puppet_ca_proxy <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_delete <- robottelo/decorators/__init__.py 
[gw0] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_enabled_parameter <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_get_search <- robottelo/decorators/__init__.py 
[gw0] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_get_search <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_compresource <- robottelo/decorators/__init__.py 
[gw1] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_puppet_proxy <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_read_puppet_proxy_name <- robottelo/decorators/__init__.py 
[gw6] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_get_per_page <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_arch <- robottelo/decorators/__init__.py 
[gw1] SKIPPED tests/foreman/api/test_host.py::HostTestCase::test_positive_read_puppet_proxy_name <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_content_view <- robottelo/decorators/__init__.py 
[gw2] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_usergroup <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_read_puppet_ca_proxy_name <- robottelo/decorators/__init__.py 
[gw4] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_subnet <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_build_parameter <- robottelo/decorators/__init__.py 
[gw2] SKIPPED tests/foreman/api/test_host.py::HostTestCase::test_positive_read_puppet_ca_proxy_name <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_env <- robottelo/decorators/__init__.py 
[gw7] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_delete <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_comment <- robottelo/decorators/__init__.py 
[gw1] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_content_view <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_enabled_parameter <- robottelo/decorators/__init__.py 
[gw0] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_compresource <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_compute_profile <- robottelo/decorators/__init__.py 
[gw6] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_arch <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_domain <- robottelo/decorators/__init__.py 
[gw5] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_name <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_user <- robottelo/decorators/__init__.py 
[gw2] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_env <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_hostgroup <- robottelo/decorators/__init__.py 
[gw5] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_user <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_medium <- robottelo/decorators/__init__.py 
[gw4] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_build_parameter <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_host_parameters <- robottelo/decorators/__init__.py 
[gw0] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_compute_profile <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_mac <- robottelo/decorators/__init__.py 
[gw6] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_domain <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_managed_parameter <- robottelo/decorators/__init__.py 
[gw3] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_comment <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_ip <- robottelo/decorators/__init__.py 
[gw2] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_hostgroup <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_model <- robottelo/decorators/__init__.py 
[gw4] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_host_parameters <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_os <- robottelo/decorators/__init__.py 
[gw1] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_enabled_parameter <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_ip <- robottelo/decorators/__init__.py 
[gw0] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_mac <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_owner_type <- robottelo/decorators/__init__.py 
[gw3] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_create_with_ip <- robottelo/decorators/__init__.py 
[gw5] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_medium <- robottelo/decorators/__init__.py 
[gw2] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_model <- robottelo/decorators/__init__.py 
[gw1] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_ip <- robottelo/decorators/__init__.py 
[gw4] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_os <- robottelo/decorators/__init__.py 
[gw0] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_owner_type <- robottelo/decorators/__init__.py 
[gw6] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_managed_parameter <- robottelo/decorators/__init__.py 
[gw7] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_comment <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_subnet <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_puppet_class <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_puppet_proxy <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_user <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_usergroup <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_puppet_ca_proxy <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_name <- robottelo/decorators/__init__.py 
tests/foreman/api/test_host.py::HostTestCase::test_positive_update_image <- robottelo/decorators/__init__.py 
[gw3] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_puppet_class <- robottelo/decorators/__init__.py 
[gw7] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_image <- robottelo/decorators/__init__.py 
[gw1] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_user <- robottelo/decorators/__init__.py 
[gw2] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_puppet_proxy <- robottelo/decorators/__init__.py 
[gw6] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_puppet_ca_proxy <- robottelo/decorators/__init__.py 
[gw4] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_subnet <- robottelo/decorators/__init__.py 
[gw5] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_name <- robottelo/decorators/__init__.py 
[gw0] PASSED tests/foreman/api/test_host.py::HostTestCase::test_positive_update_usergroup <- robottelo/decorators/__init__.py 

======================================== 55 passed, 2 skipped in 291.17 seconds ========================================

without the shared the test results was: 55 passed in 511.71 seconds time gain 43%

data file created location: /tmp/robottelo/shared_functions/9c6af4d0664266ba2f0f7931c28eaf2d.shared_function.tests.foreman.api.test_host.HostTestCase.setUpClass

the key: “9c6af4d0664266ba2f0f7931c28eaf2d” is md5 of the downloaded katello certificate of the server

data file content: json {"state": "READY", "creation_datetime": "2017-03-24T13:22:13", "result": {"compresource_libvirt_id": 39, "loc_id": 767, "puppet_classes": [1], "cv_id": 449, "org_id": 766, "lce_id": 401, "image_id": 27, "env_id": 380}, "error": null, "pid": 15985, "id": "e01c45d7840e42e1833915729ae3bc78"}

The latest setUpClass can be rewritten like, to return the to_json_dict of each nailgun entity ```python @classmethod @shared(inject=True) def setUpClass(cls, org=None, loc=None, cv=None, env=None, lce=None, puppet_classes=None, image=None, compresource_libvirt=None, injected=False): “”“Setup common entities.”“” super(HostTestCase, cls).setUpClass() if injected: # the returned kwargs are dicts restored from to_json_dict of # each entity except for puppet_classes that is ids list cls.org = entities.Organization().read(attrs=org) cls.loc = entities.Location().read(attrs=loc) cls.cv = entities.ContentView().read(attrs=cv) cls.env = entities.Environment().read(attrs=env) cls.lce = entities.LifecycleEnvironment().read(attrs=lce) cls.puppet_classes = [entities.PuppetClass(id=cp) for cp in puppet_classes] cls.compresource_libvirt = entities.LibvirtComputeResource().read( attrs=compresource_libvirt) # the image need an explicit read from server cls.image = entities.Image( id=image[‘id’], compute_resource=cls.compresource_libvirt).read() else: cls.org = entities.Organization().create() cls.loc = entities.Location(organization=[cls.org]).create() # Content View and repository related entities cls.cv = publish_puppet_module( [{‘author’: ‘robottelo’, ‘name’: ‘generic_1’}], CUSTOM_PUPPET_REPO, organization_id=cls.org.id ) cls.env = entities.Environment().search( query={‘search’: u'content_view=“{0}”‘.format(cls.cv.name)} )[0].read() cls.lce = entities.LifecycleEnvironment( organization=cls.org.id).search(query={ 'search’: ‘name={0} and organization_id={1}’.format( ENVIRONMENT, cls.org.id) } )[0].read() cls.puppet_classes = entities.PuppetClass().search(query={ ‘search’: u'name ~ “{0}” and environment = “{1}”‘.format( 'generic_1’, cls.env.name) }) # Compute Resource related entities cls.compresource_libvirt = entities.LibvirtComputeResource( organization=[cls.org], location=[cls.loc], ).create() cls.image = entities.Image( compute_resource=cls.compresource_libvirt).create()

    return dict(org=cls.org, loc=cls.loc, cv=cls.cv, env=cls.env,
                lce=cls.lce, compresource_libvirt=cls.compresource_libvirt,
                puppet_classes=[pc.id for pc in cls.puppet_classes],
                image=cls.image)
with this lasted modification the results was :  55 passed, 2 skipped in 279.71 seconds 
and time gain is 45%

shared file contain:

{“state”: “READY”, “creation_datetime”: “2017-03-27T10:35:49”, “result”: {“loc”: {“subnet”: [], “domain”: [], “description”: null, “smart_proxy”: [], “compute_resource”: [], “id”: 1683, “environment”: [], “config_template”: [{“id”: 7}, {“id”: 8}, {“id”: 9}, {“id”: 41}, {“id”: 10}, {“id”: 11}, {“id”: 14}, {“id”: 13}, {“id”: 12}, {“id”: 72}, {“id”: 71}, {“id”: 42}, {“id”: 43}, {“id”: 15}, {“id”: 16}, {“id”: 82}, {“id”: 44}, {“id”: 45}, {“id”: 17}, {“id”: 18}, {“id”: 19}, {“id”: 46}, {“id”: 20}, {“id”: 47}, {“id”: 76}, {“id”: 21}, {“id”: 22}, {“id”: 23}, {“id”: 39}, {“id”: 37}, {“id”: 38}, {“id”: 26}, {“id”: 28}, {“id”: 27}, {“id”: 29}, {“id”: 48}, {“id”: 40}, {“id”: 30}, {“id”: 31}, {“id”: 33}, {“id”: 32}, {“id”: 34}, {“id”: 49}, {“id”: 50}, {“id”: 4}, {“id”: 5}, {“id”: 6}, {“id”: 2}, {“id”: 3}, {“id”: 1}, {“id”: 51}, {“id”: 52}, {“id”: 53}, {“id”: 77}, {“id”: 73}, {“id”: 75}, {“id”: 74}, {“id”: 69}, {“id”: 35}, {“id”: 36}], “user”: [], “media”: [], “organization”: [{“id”: 1682}], “hostgroup”: [], “name”: “nXKdpMIf”}, “puppet_classes”: [1], “image”: {“username”: “\ud85d\udd2f\u7caa\u4433\u96d2\ud6bc\ud84d\udea6\ub28d\ucfa1\uc17a\u7839\ua03f\ud86d\udcf0\ud864\udd25\u9b6a\u0f59\ud846\udc81\u44ad\u424c\ud85e\udd70\ud861\udd5e\ud854\udd2f\u3d01\u37f6\ua22e\u9fb1\ud85f\udc52”, “uuid”: “\u85d0\ud802\udf24\ud866\udffd\u790d\u044d\u3d11\ud862\udf12\ud84b\udf1a\u9845\uc692\u7aa4”, “compute_resource”: {“provider_friendly_name”: “Libvirt”, “url”: “http://xhedhJrraY.gov”, “name”: “f0QWO1RBuuz”, “location”: [{“id”: 1683}], “provider”: “Libvirt”, “organization”: [{“id”: 1682}], “display_type”: “spice”, “id”: 75, “set_console_password”: true, “description”: null}, “operatingsystem”: {“id”: 978}, “architecture”: {“id”: 977}, “id”: 41, “name”: “CWZwqv”}, “compresource_libvirt”: {“provider_friendly_name”: “Libvirt”, “url”: “http://xhedhJrraY.gov”, “name”: “f0QWO1RBuuz”, “location”: [{“id”: 1683}], “provider”: “Libvirt”, “organization”: [{“id”: 1682}], “display_type”: “spice”, “id”: 75, “set_console_password”: true, “description”: null}, “lce”: {“organization”: {“id”: 1682}, “prior”: null, “description”: null, “name”: “Library”, “id”: 866}, “env”: {“organization”: [{“id”: 1682}], “location”: [{“id”: 2}], “id”: 917, “name”: “KT_iJrMFepW_Library_CKvnAyTVcf_924”}, “org”: {“subnet”: [], “domain”: [], “description”: null, “default_content_view”: {“id”: 923}, “smart_proxy”: [{“id”: 1}], “user”: [], “title”: “iJrMFepW”, “hostgroup”: [], “label”: “iJrMFepW”, “environment”: [], “compute_resource”: [], “config_template”: [{“id”: 7}, {“id”: 8}, {“id”: 9}, {“id”: 41}, {“id”: 10}, {“id”: 11}, {“id”: 14}, {“id”: 13}, {“id”: 12}, {“id”: 72}, {“id”: 71}, {“id”: 42}, {“id”: 43}, {“id”: 15}, {“id”: 16}, {“id”: 82}, {“id”: 44}, {“id”: 45}, {“id”: 17}, {“id”: 18}, {“id”: 19}, {“id”: 46}, {“id”: 20}, {“id”: 47}, {“id”: 76}, {“id”: 21}, {“id”: 22}, {“id”: 23}, {“id”: 39}, {“id”: 37}, {“id”: 38}, {“id”: 26}, {“id”: 28}, {“id”: 27}, {“id”: 29}, {“id”: 48}, {“id”: 40}, {“id”: 30}, {“id”: 31}, {“id”: 33}, {“id”: 32}, {“id”: 34}, {“id”: 49}, {“id”: 50}, {“id”: 4}, {“id”: 5}, {“id”: 6}, {“id”: 2}, {“id”: 3}, {“id”: 1}, {“id”: 51}, {“id”: 52}, {“id”: 53}, {“id”: 77}, {“id”: 73}, {“id”: 75}, {“id”: 74}, {“id”: 69}, {“id”: 35}, {“id”: 36}], “library”: {“id”: 866}, “media”: [], “id”: 1682, “name”: “iJrMFepW”}, “cv”: {“puppet_module”: [{“id”: 63}], “description”: null, “repository”: [], “composite”: false, “component”: [], “last_published”: “2017-03-27 10:35:30 UTC”, “label”: “CKvnAyTVcf”, “version”: [{“id”: 921}], “organization”: {“id”: 1682}, “id”: 924, “next_version”: 2, “name”: “CKvnAyTVcf”}}, “error”: null, “pid”: 28341, “id”: “2422861e89fd4de8b4d703d43d733266”}

```

Also wanted to make test with subscription upload in setUpClass but using the use Katello agent that are failing any way.

Updated 27/03/2017 11:16 2 Comments

Simplify Print Statements to Make Code More Readable in CLI

openwhisk/openwhisk
  • Extract parameters from externalized strings automatically
  • Generate map of parameters/arguments using a print/format method

Current way to print in the CLI: fmt.Fprintf( color.Output, wski18n.T( "{{.ok}} created action {{.name}}\n", map[string]interface{}{ "ok": color.GreenString("ok:"), "name": boldString(entityName), }))

Printing the same message with this update: print( "{{.ok}} created action {{.name}}\n", color.GreenString("ok:"), boldString(action.Name))

Updated 24/03/2017 01:54 2 Comments

[6.2.z] Experimental support of Microsoft Edge with Microsoft WebDriver

SatelliteQE/robottelo

Cherry-pick of #4424 with minor 6.2.z-specific change

Sample test results (with selenium-3.3.1): ```python py.test tests\foreman\ui\test_activationkey.py -k test_positive_create_with_name ============================= test session starts ============================= platform win32 – Python 2.7.13, pytest-2.9.2, py-1.4.33, pluggy-0.3.1 rootdir: D:\Documents\Workspace\robottelo, inifile: collected 36 items 2017-03-22 15:52:11 - conftest - DEBUG - Found WONTFIX in decorated tests [‘1156555’, ‘1269196’, ‘1245334’, ‘1221971’, ‘1217635’, ‘1226425’, ‘1204686’, ‘1267224’, ‘1103157’, ‘1230902’, ‘1214312’, ‘1079482’]

2017-03-22 15:52:11 - conftest - DEBUG - Collected 36 test cases

tests\foreman\ui\test_activationkey.py .

========== 35 tests deselected by ‘-ktest_positive_create_with_name’ ========== ========= 1 passed, 35 deselected, 1 pytest-warnings in 42.92 seconds ========= ```

Updated 22/03/2017 14:14 2 Comments

Update Host.create_missing with additional reads.

SatelliteQE/nailgun

Inspired by @abalakh comment in https://github.com/SatelliteQE/robottelo/pull/4458#issuecomment-287330692

Host’s create_missing helper tried to access to some fields inside nested entities without checking whether these fields actually present. And they don’t when passing id to Host instead of Entity object obtained by read, so additional read is necessary.

Before: python In [4]: entities.Host(config, environment=1).create(create_missing=True) AttributeError: 'Environment' object has no attribute 'location' In [5]: entities.Host(config, domain=1).create(create_missing=True) AttributeError: 'Domain' object has no attribute 'location' In [6]: entities.Host(config, operatingsystem=1).create(create_missing=True) AttributeError: 'OperatingSystem' object has no attribute 'architecture' After: ```python In [5]: entities.Host(config, environment=1).create(create_missing=True) Out[5]: nailgun.entities.Host( environment=nailgun.entities.Environment(nailgun.config.ServerConfig(…, id=1), …)

In [6]: entities.Host(config, domain=1).create(create_missing=True) Out[6]: nailgun.entities.Host(domain=nailgun.entities.Domain(nailgun.config.ServerConfig(…, id=1), …)

In [7]: entities.Host(config, operatingsystem=1).create(create_missing=True) Out[7]: nailgun.entities.Host(operatingsystem=nailgun.entities.OperatingSystem(nailgun.config.ServerConfig(…, id=1), …)

In [8]: entities.Host(config, medium=1).create(create_missing=True) Out[8]: nailgun.entities.Host(medium=nailgun.entities.Media(…, id=1), …) ```

Updated 22/03/2017 13:44 4 Comments

image picking permission

couchbaselabs/mobile-training-todo

Starting with API level 23, permissions must now be requested while the app is running rather than prior to installation. We can’t add the READ_EXTERNAL_STORAGE permission to AndroidManifest.xml anymore (used for image picking) and must do it in code when the user is about to select perform that action. This change prompts the user for that permission when the camera icon is clicked for the first time.

fix #115

Updated 22/03/2017 12:51

Development

Grandmagic13/RPGManager

@Grandmagic13 Kérlek nézd át, mert teljesen átdolgoztam a Languages implementálását.

  • created new MultipleFieldsGetterSetterLanguages
  • created new Fields.LANGUAGES
  • created new Fields.LANGUAGES_SETTER
  • created new Languages enum and LanguagesSetter class
  • modified junit tests
  • write some modification in Background enum to get default languages values for each backgrounds
Updated 23/03/2017 08:48

797 798 column layout

hbz/oerworldmap

fixes #797 fixes #798 probably fixes #986 … has to be tested on ios ff … nevertheless, header has fixed height now, so worst case the “map” will be lost in the logo

Updated 22/03/2017 13:01 2 Comments

"Type type exists in both System.dll and Bridge.dll" error when building from command line

bridgedotnet/Bridge

Error d:\WWW\DemoTest131\Build\Assets\Scripts\Main.cs (48:34) error: The type 'System.Text.RegularExpressions.Regex' exists in both 'x:\Windows\Microsoft.NET\Framework\v4.0.30319\System.dll' and 'd:\WWW\DemoTest131\Build\Bridge.dll'

Error appears only when System.Text.RegularExpression.Regex is mentioned in the code and when compiling from the command line. I can mention it freely if I compile from Visual Studio and it’s OK.

Here is the command line I am using: X:\WINDOWS\Microsoft.NET/Framework/v4.0.30319\csc.exe /reference:"D:/WWW/DemoTest131/Build/Bridge.dll" /reference:"D:/WWW/DemoTest131/Build/Bridge.Html5.dll" /nostdlib /target:library /out:"D:/WWW/DemoTest131/Build/Main.dll" /recurse:"D:\WWW\DemoTest131\Build\*.cs"

Updated 22/03/2017 15:19 5 Comments

Added JointPlotVisualizer - Issue 101

DistrictDataLabs/yellowbrick

JointPlotVisualizer is a visualizer that plots the relationship between a feature and target in the joint axis and plots the distribution of each variable along the x and y axis. It inherits from FeatureVisualizer. The notebook contains the code and an example of how to use it.

Currently, there are two options for the joint plots - scatter plot and hexbin plot. There is one option for the x and y axis plots - histogram. The visualizer is designed such that more options can be added to the joint plot and the x and y axis plots.

TODO: add test cases

Updated 23/03/2017 00:42 3 Comments

Match- and MultiMatchQueryBuilder should only allow setting analyzer on string values

elastic/elasticsearch

Currently the user can set an analyzer on e.g. a numeric query, but explicitely setting an analyzer only make sense for input text. Otherwise we might analyze e.g. floats in scientific notation like 1.34e-6 to just an e which leads to NumberFormatExceptions on each shard later (if targeting a numeric field).

Closes #21665

Updated 23/03/2017 11:06 2 Comments

Broadway baby reviews

newtheatre/history-project
  • [ ] Cross stiching 2008 http://broadwaybaby.com/shows/cross-stitching/25085 / https://archive.fo/JWfRM
  • [ ] The Project https://archive.fo/WhWJn
  • [ ] Paradise https://archive.fo/lCx4n
  • [ ] Great Gatsby https://archive.fo/Iy6jD
  • [ ] Hand me down people https://archive.fo/7AYAh
  • [ ] Warehouse 364 https://archive.fo/fWgFP
  • [ ] Toyland murders https://archive.fo/NUTaJ (association?)
  • [x] The retreat https://archive.fo/Zoaim
  • [x] Only One Wing https://archive.fo/UB36S (Says nottingham new theatre at bottom)
  • [x] Porphyria https://archive.fo/jWFrS
  • [x] 18B https://archive.fo/BFUDF
  • [x] Chasing Dragons https://archive.fo/jldja
  • [x] Queen B https://archive.fo/XSwWA
  • [x] Beef https://archive.fo/ey67G

Other

image

Updated 25/03/2017 17:07

Fork me on GitHub