Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

without the double star, the formating inject all the environment #5637

Merged
merged 1 commit into from
Jan 9, 2020

Conversation

ochriste
Copy link
Member

variables as a gigantic string and the code fail wonderfully.

export TOTO=foobar
python

import os
print('{TOTO}'.format(**os.environ))
foobar

@@ -56,6 +56,12 @@ is the name of the PostGIS table containing the layer's geographic data. It is
a string of the form ``[<schemaname>.]<tablename>``. If ``schemaname`` is
omitted, the table is assumed to be in the ``public`` schema. The label
corresponding to this field is *Related Postgres table* in the admin interface.
The ``geoTable`` field support named formating and can get values from the
environment variables, for example:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space

@ochriste ochriste force-pushed the fix-format-in-geo-table branch 2 times, most recently from c1980cd to 63e4faf Compare December 20, 2019 13:01
Copy link
Member

@sbrunner sbrunner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :-)


``[<schemaname>_{some-named-variable}.]<tablename>``

with "some-named-variable" defined in the environment.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
with "some-named-variable" defined in the environment.
``[<database-connexion-name>.[<schemaname>_{some-named-variable}.]]<tablename>``

It should probably not added here, but it's missing...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have never seen this case ever before, is it an actual existing possibility ?
do you have a practical example of that ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I remember @asaunier use it recently, it is linked to the dbsessions, see: https://camptocamp.github.io/c2cgeoportal/master/integrator/multiple_databases.html

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok thanks

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :-)

@ochriste ochriste force-pushed the fix-format-in-geo-table branch 2 times, most recently from af6d0e9 to fb79f3e Compare December 20, 2019 15:12
@@ -57,6 +57,19 @@ a string of the form ``[<schemaname>.]<tablename>``. If ``schemaname`` is
omitted, the table is assumed to be in the ``public`` schema. The label
corresponding to this field is *Related Postgres table* in the admin interface.

The ``geoTable`` field support named formatting and can get values from the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support -> supports

@ochriste ochriste force-pushed the fix-format-in-geo-table branch 2 times, most recently from 47e0abc to c0c023d Compare January 6, 2020 07:48
@sbrunner
Copy link
Member

sbrunner commented Jan 6, 2020

CI will be fixed with: #5664

@ochriste ochriste force-pushed the fix-format-in-geo-table branch 7 times, most recently from bcd30e7 to 1056d74 Compare January 8, 2020 13:45
variables as a gigantic string and the code fail wonderfully.

export TOTO=foobar
python

>>> import os
>>> print('{TOTO}'.format(**os.environ))
foobar
@ochriste ochriste merged commit f4ba02a into 2.4 Jan 9, 2020
@ochriste ochriste deleted the fix-format-in-geo-table branch January 9, 2020 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants