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
Adding auto generated code data type #213
Comments
I think it will be a good addition and we should not limit it only to
spatial codes,it can alsobbe applied in other contexts/entities.
Do you want to go ahead with the implementation? If so, could you prepare a
few design notes on the implementation.
Thanks.
…On Wed, 8 Feb 2017 at 01:38 Wondimagegn Tesfaye ***@***.***> wrote:
The code data type is useful to generate unique spatial unit code from
administrative units. It will be great to integrate it.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#213>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADqZC4da5V-XpUmeucW3mj6HrtImLnEoks5raQBhgaJpZM4L6MB5>
.
|
I think I can add it with the same implementation as Turkana parcel code for STDM 1.5 as the code already exists. But it can be re-designed and even use expression builder for STDM 2.0. What do you think? |
Can it be adopted for use in other entities apart from spatial entities
such as auto numbering a household's code? What user/column properties can
be customized e.g. Length of characters,choice of characters (string only
such as AZD, number only 001,alphanumeric 001A etc.)
Regards,
John
…On Wed, 8 Feb 2017 at 09:37 Wondimagegn Tesfaye ***@***.***> wrote:
I think I can add it with the same implementation as Turkana parcel code
for STDM 1.5 as the code already exists. But it can be re-designed and even
use expression builder for STDM 2.0. What do you think?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#213 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADqZC_sRityPg12OdmbWYum1ZlUQL3mDks5raXCygaJpZM4L6MB5>
.
|
As it is column data type that should be chosen in the Column Editor, it should work for all entities. If there is more time, it can be customized to have what you have said. However, for 1.5, we can just focus of allowing the user to set administrative units creating the codes from the administrative unit codes and adding a serial number at the end. However, allowing users to decide on prefix and suffix of codes might require more time. |
OK with me. @pgathogo comments? |
The feature is included. However, considering the time and the use, I decided to add two properties. leading_zero (to be included later) In the editor, the user needs to click on the button to generate a code for None prefix, and select a value/code in lookup columns and admin_spatial_unit_set prefix source. In configuration.stc
Issue
But when I restart QGIS, the configuration object is not reading the prefix_source. It shows empty. What am I missing?
config_serializer codes
|
Hi Wondie, This is a great feature! Quick question, is there an option of generating a code without the leading zeroes i.e. just plain 1, 2 ... or F/1, M1 ... or NY/OK/1, MK/8? Regarding your issue, the code for deserializing the unique code from the file does not load information regarding the prefix source. You need to read the child element and extract the value from prefix_source attribute then add it into the list of optional arguments. Please have a look at the GeometryColumn here implementation where the geometry type, SRID and layer display name are extracted from the column child element and loaded into the constructor mandatory and optional arguments respectively. A few other general comments regarding the code:
Regards, John |
Hi John, Thank you for the help and feedback. Regarding the issue, the line you shared me doesn't show anything is pulled from the xml. It is setting values. I actually have tried that and still it is not getting values from the xml. On the comments, I will work on all them. However, I have a comment for the display name of the column, do you think Auto Generate will be understandable for the user? Regards, |
The link i sent you indicates that you need to override '_obj_args' class
method so that you can pass additional arguments in the constructor. In
this case, the column element is already contained in the 'element'
parameter hence you need to get the 'Code' child element from column
element then read the 'prefix_source' attribute then add it to kwargs so
that this value can be passed in the class constructor of your class.
Please critically review the link i sent and get the flow from its
implementation. Hope this is clear.
As for the display name, i thought 'Auto generated code' should be clear to
the user.
Regards,
John
…On Thu, 9 Feb 2017 at 18:10 Wondimagegn Tesfaye ***@***.***> wrote:
Hi John,
Thank you for the help and feedback.
Yes, we can add "None" so that there will be no leading zero.
I can also add separator options such as / - _ and None so that users can
choose them.
Regarding the issue, the line you shared me doesn't show anything is
pulled from the xml. It is setting values. I actually have tried that and
still it is not getting values from the xml.
On the comments, I will work on all them. However, I have a comment for
the display name of the column, do you think Auto Generate will be
understandable for the user?
Regards,
Wondimagegn
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#213 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADqZC9brk5HFDa6vW3LAu2FDBDM-BTJoks5razqDgaJpZM4L6MB5>
.
|
Ok cool will re-check and update you on the issue.
Regarding the display name, if if code is added it is clear. So Auto
Generated code is good.
Regards,
Wondimagagn
…On Feb 9, 2017 19:35, "Kahiu" ***@***.***> wrote:
The link i sent you indicates that you need to override '_obj_args' class
method so that you can pass additional arguments in the constructor. In
this case, the column element is already contained in the 'element'
parameter hence you need to get the 'Code' child element from column
element then read the 'prefix_source' attribute then add it to kwargs so
that this value can be passed in the class constructor of your class.
Please critically review the link i sent and get the flow from its
implementation. Hope this is clear.
As for the display name, i thought 'Auto generated code' should be clear to
the user.
Regards,
John
On Thu, 9 Feb 2017 at 18:10 Wondimagegn Tesfaye ***@***.***>
wrote:
> Hi John,
>
> Thank you for the help and feedback.
> Yes, we can add "None" so that there will be no leading zero.
> I can also add separator options such as / - _ and None so that users can
> choose them.
>
> Regarding the issue, the line you shared me doesn't show anything is
> pulled from the xml. It is setting values. I actually have tried that and
> still it is not getting values from the xml.
>
> On the comments, I will work on all them. However, I have a comment for
> the display name of the column, do you think Auto Generate will be
> understandable for the user?
>
> Regards,
> Wondimagegn
>
> —
> You are receiving this because you commented.
>
>
> Reply to this email directly, view it on GitHub
> <#213 (comment)>, or
mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/
ADqZC9brk5HFDa6vW3LAu2FDBDM-BTJoks5razqDgaJpZM4L6MB5>
> .
>
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#213 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AJQoOLhltzACKy3ZB8flqJgyBgJOZY9Sks5ra0BigaJpZM4L6MB5>
.
|
This feature is now incorporated to master with this commit. |
I have fixed the combobox size in this commit. |
All issues are fixed now. Until issues are found, I will close it. |
The code data type is useful to generate unique spatial unit code from administrative units. It will be great to integrate it.
The text was updated successfully, but these errors were encountered: