On vrijdag 26 januari 2018 22:25:55 CET eil...@themaii.org wrote:
> well, you certainly got me correct! I'm fairly new to python - didn't do
> much coding to learn. Trial by fire, sort of. and the original person who
> put this together is now gone from the company and won't answer any
> outstanding questions. Plus, I *think* he got most of the code from 3rd
> party sources. I could be wrong on that. I was raised on Perl and PL/I (as
> ancient as the latter may seem)
I meant to follow this up, didn't have the opportunity till now.
I strongly suggest to get the python basics down. Your Perl hash is your python dict, array is a list (tuple for "read only" lists) and you have you basic scalars with str, bool, int and float. And you have objects. In fact, everything, including scalars, class definitions, methods and functions are objects.
Standard comparison is "==". The "is" comparison is stricter and only used for boolean values and the special value None (also handy to know is that functions / methods that do not return anything actually return None).
One can think of "is" comparison as "equal to and of the same type":
>>> empty = ''
>>> empty is None
False
>>> empty is False
False
>>> empty is True
False
>>> bool(empty)
False
>>> bool(empty) is False
True
>>> bool(None)
False
If you want a quick intro to Python, I highly suggest Python Tips.
Finally, it's important to know Django project layout and in your case, getting a handle on views and querysets.