Hi! I'm not fully acquainted with Heroku connect, but here's the pdf docs: 
https://buildmedia.readthedocs.org/media/pdf/django-heroku-connect/stable/django-heroku-connect.pdf
 on 
page 9 you can find:
heroku_connect.E006 The Salesforce object name must be unique since an 
object can only mapped to a PostgreSQL table once. 

Probably need to check the docs and see that two TABLES do NOT have the 
same name, according to the error. You might also want to check your other 
tables to make sure their attributes/columns are not the same. That's just 
theory, since I'm not too sure.

On Wednesday, July 17, 2019 at 11:26:04 AM UTC-4, Elia Gandolfi wrote:
>
> # I want this Heroku-Connect model to be my app's custom user model.
> # That means, vendors registered in my Salesforce database should be able 
> to login with their vendor_code__c as username
> class Vendor(hc_models.HerokuConnectModel):
> sf_object_name = 'Vendor__c'
>
> vendor_code = hc_models.ExternalID(sf_field_name='Vendor_Code__c', unique=
> True, upsert=False) # this should be the username
> sf_id = hc_models.fields.ID(db_column='sfid', db_index=True, editable=
> False, max_length=18, sf_field_name='ID', unique=True, upsert=False)
> name = hc_models.Text(sf_field_name='Name', max_length=80)
> email = hc_models.Text(sf_field_name='Email__c', max_length=80)
>
> # I've tried to replicate the vendor model with multi-table inheritance, 
> found here
> # 
> https://django-heroku-connect.readthedocs.io/en/latest/models.html#multi-table-inheritance
> class vendoruser(Vendor):
> hc_model = models.OneToOneField(Vendor, on_delete=models.CASCADE, to_field
> ='vendor_code', parent_link=True, db_constraint=False)
>
> # the idea is to extend the model from here. I do as in the example, but I 
> get blocked right away with the following error
>
> """
> salesforce.vendoruser: (heroku_connect.E006) 
> salesforce.vendoruser.sf_object_name 'Vendor__c' clashes with another model.
> HINT: Make sure your 'sf_object_name' is correct.
> """
>
> # I've also tried to use hc_models.OneToOneField or hc_models.ForeignKey 
> but it's not supported
> # Any suggestion on how to work around this?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/531f0d35-b323-4c27-9d34-5680bde513ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to