hamdjan__: Eh, can you rephrase? Or maybe show us an example of what you mean?
idontneedanick has quit
idontneedanick2 joined the channel
rufus_
HI there! I have a model which includes some foreignkeys...When creating the template using for loop, I would like these foreignkeys fields to appear at the top of each relative subfield...but same are repeated on each line...where is my mistake? https://dpaste.de/Pwit
mattmcc, oh, then i'll retry and see what went wrong, thanks
dcrouch has quit
rodorgas has quit
mattmcc
rufus_: What does your view look like?
isthmian joined the channel
rufus_
mattmcc: hi. on any row for the staff name, position etc, also the header branch is repeated, while I would like the branch name appearing only once at the top of the staff names..
isthmian has quit
cyphase joined the channel
ironfroggy joined the channel
lucas_ai joined the channel
BlindHunter joined the channel
hamdjan__ (yep, got it working now, had some for loop mistakes)
lumidify has quit
deltaskelta has quit
deltaskelta joined the channel
bayman joined the channel
bayman
do i need sendmail installed for django to send mail and error reports?
lucas_ai joined the channel
Paradisee joined the channel
Jaxkr joined the channel
mattmcc
No, but you do need to tell Django what SMTP server to use.
Jaxkr
recommended method of redirecting to ?next?
mattmcc
Whether that's local, some MTA of your own, or a service like Mailgun.
ah ok, thanks. and can I set primary_key=True on the related model even if it's not a true primary key?
i.e. not distinct for every row
mattmcc
Not sure I follow.
k_sze[work] has quit
sifat
e.g. model A has only the field username. model B has username and company. In a view, I want to display the usernames found in model A (comes from a MS SQL DB), and the company from model B (comes from Salesforce).
adsworth joined the channel
mattmcc
Okay, the ORM doesn't really support tables that lack a proper primary key.
sifat
I see. In this scenario, how would I look up the company name from a username from the MS SQL model? (note that I've brought both into ORM)
deltaskelta has quit
jaykay joined the channel
since the company name only exists in the Salesforce model
mattmcc
Seems like you want ForeignKey(ModelB, to_field='username')
bx2 joined the channel
sifat
ah ok, let me try that. Were you saying that this is unsupported in Django ORM?
mattmcc
No, that works fine. The potential problem is if the tables really do lack a primary key.
If username is unique, you might be able to use that.
olrrai has quit
sifat
doesn't Django automatically build a primary key for each model unless I specify primary_key=True for a particular field?
jessamynsmith joined the channel
mattmcc
It puts a field named 'id' on the model, but that has to also exist on the table.
sifat
oh ok. in that case, Salesforce does have one. the MS SQL table holding usernames doesn't. but the usernames are unique on the MS SQL table