Hacker News new | past | comments | ask | show | jobs | submit login

Is mylist = []; mylist == [] really a thing for testing for an empty list? Seems very unpythonic.

My newbieish mistake was assuming (forgetting!) that NULLs aren't distinct/unique, so you can not enforce a nullable column unique and expect only a single NULL value. There is a way around it with conditional constraints ... but unique=True or unique_together is not it.

It's really an RDBMS thing, not a Django thing, but when Django abstracts away the RDBMS, one forgets.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: