Jump to content
UBot Underground

How To Fetch Salesforce Attachment File Content With Django-Salesforce?


Recommended Posts

I'm building up a Django 1.11 application filling in as a UI for some Salesforce Objects utilizing django-salesforce for the correspondence with Salesforce. 

 

I need to give clients the choice to download records from Salesforce Attachment objects identified with their Contact. 

 

# Django Attachment demonstrate on my_app/models.py 

 

class Attachment(models.Model): 

 

parent = models.ForeignKey(Contact, models.DO_NOTHING, 

 

sf_read_only=models.NOT_UPDATEABLE) 

 

name = models.CharField(max_length=255, verbose_name='File Name') 

 

content_type = models.CharField(max_length=120, blank=True, null=True) 

 

body_length = models.IntegerField(sf_read_only=models.READ_ONLY) 

 

body = models.TextField() 

 

On this Attachment demonstrate I can get to the rest URL for the record content on the body field, yet not the real substance. 

 

Is there a method for getting document content from the Attachment without implementing an OAuth customer only for this?

Link to post
Share on other sites

Not sure I follow you here.

Is the information available publicly? If no then you would have to login with credentials in some way especially if you want to use their REST API.

You will need to get an app key, secret key and all that according to the docs.

https://github.com/django-salesforce/django-salesforce

Or are you just trying to parse the data somehow?
If so, from the sqlite DB?

 

Additionally, are you trying to use just Python, irongpython(cant) or Python with "execute python " plugin?

Regards,
CD

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...