On Sat, Jan 17, 2015 at 8:09 PM, James Schneider
<jrschneide...@gmail.com> wrote:
> You can definitely do it that way if all you need to do is check if values
> exist and provide a default if they don't. I do this all the time for my
> __str__() methods as well.
> You also mentioned similar situations that may require more logic checks
> (variables depending on each other or printing computed values), then the
> try/except strategy is likely more flexible.

Thanks for reply and advice James, I really appreciate it. :)

It's funny that I haven't had this problem before … Either I've never
gone too far down the __str__() FK chain and avoided AttributeErrors
or I've always had FKs so that were required (so, no error on save).

Anyway, I really appreciate the reply and tips/advice.

Thanks everyone! Django sure does have an awesome open source community.

Cheers,
m

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKzdcNkU-ouU8kDc32wpKBraqDJyTdQwnaHD6hJ1afSyjk31yg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to