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

Set the main owner for the attribution credits in layer properties #55

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Gustry
Copy link
Member

@Gustry Gustry commented Jan 18, 2021

WIP for now :

  • Missing tests
  • Not very fine with what I did for now, code style.
  • Should we auto-populate the layer properties when displayed in the dock automatically ?
  • What about the logic to set the attribution from the main "owner".
  • Should we put the SQL query as a function in the database ?

@Gustry Gustry added the enhancement New feature or request label Jan 18, 2021
@Gustry Gustry requested a review from mdouchin January 18, 2021 13:52
@Gustry Gustry marked this pull request as draft January 18, 2021 13:53
Copy link
Contributor

@mdouchin mdouchin left a comment

Choose a reason for hiding this comment

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

Do you want to convert all data into QGIS metadata in this PR, or only title and abstract ? If the whole QGIS metadata data must be changed, I am wondering wether we should use pygeometa or not to convert PgMetadata into QMD ? This would need to have a view converting PgMetadata to YML, which could be done easily IMHO

return

# QGIS Server panel
layer.setAttribution(data[0][0])
Copy link
Contributor

Choose a reason for hiding this comment

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

We could also add title and abstract to the QGIS Server corresponding properties ? Related to Lizmap plugin too

Copy link

Choose a reason for hiding this comment

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

which code can we use to add title and abstract to the QGIS server corresponding properties?

Copy link
Member Author

Choose a reason for hiding this comment

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

@Mwekezi I think you should raise your topic in an issue, but not in a pull request. This one was a WIP, work in progress.
You need to use some Python to make it automatic for now. (semi-automatic to synchronize database metadata into the layer properties)

Copy link

Choose a reason for hiding this comment

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

Thank you. I tried running this code in the python console of QGIS but it didn't work. It mentioned an indentation error. Could you help with how I could successfully run the code above.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi,
"Indentation error" is the most common Python error. Before digging in this project, I suggest you to read about programming with Python, follow a tutorial about Python, you will be able to understand why you couldn't run the code.


# Metadata panel
metadata = layer.metadata()
metadata.setRights([data[0][0]])
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we always override existing metadata, or only if a new checkbox is checked in options ?

Copy link

Choose a reason for hiding this comment

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

Did you successfully run the code above?

@Mwekezi
Copy link

Mwekezi commented Sep 23, 2021 via email

@Gustry Gustry force-pushed the master branch 2 times, most recently from 6e727be to 54127c8 Compare February 14, 2022 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants