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

Customizing Downloaded Filename #335

Open
someevil opened this issue Aug 6, 2018 · 2 comments
Open

Customizing Downloaded Filename #335

someevil opened this issue Aug 6, 2018 · 2 comments

Comments

@someevil
Copy link

someevil commented Aug 6, 2018

Hey,

I am wondering if it would be relatively simple for me to modify this code somehow to not use the ObjectID in the naming of the file, but instead use a column I have in my feature layers called ASSET_ID?

Basically can I reference this other column when the code re-names the photos?

Cheers

@someevil
Copy link
Author

someevil commented Aug 6, 2018

I think what I am trying to do is not possible, as the Asset_ID is not kept in the same table as the attachment info... this is the info the object holds:
{'id': 19, 'globalId': '73d1d45a-cf17-46fd-91e9-9ca1def7cb39', 'parentGlobalId': 'a151e9bc-7042-49d6-9d19-2a3e7fefd2af', 'name': 'Photo1.jpg', 'contentType': 'image/jpeg', 'size': 553514, 'keywords': ''}

I would have to do some fancy join back on the global ID, then find the asset_id, which I think is above my skill level!

@dwaggenspack
Copy link

#Query to get list of object ids in layer
featureObjectIds = featureLayer.query(where='1=1', return_ids_only=True)

Well, to give you some guidance, this is where you will need to start your quest. Note how "return_ids_only" is set to true. You should be able to get your feature's field data by changing that.

I know this isn't a full answer, but it should be a nudge in the right direction. I don't know everywhere that would need to be changed/added as I have only skimmed the code.

Good Luck!

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

No branches or pull requests

2 participants