JSHeroes 2018 | Cluj-Napoca

Last month I participated at the largest tech conference solely dedicated to JavaScript from Romania, called JSHeroes. It took place in the beautiful city of Cluj-Napoca, the city that I’ve proudly called home for the last four years.

It was an awesome experience, filled with useful knowledge and insight concerning the current state of JavaScript as a language and all the frameworks that the JS developer community uses.

Continue reading “JSHeroes 2018 | Cluj-Napoca”

Angular Data Services, helped by the beauty of BehaviourSubjects (they are not BS)

The rule of thumb in all of Angular (2+), alongside the complete rewriting of the HTTP Client in 4.3, is that the data flow should be handled using Observables. All of the Client’s calls are themselves Observables, to which you can subscribe and receive the required data on completion.

This should be a good way to handle your data, but what happens when you want to create a Service that manages your data, as models, or maybe just as JS primitives, store them, and modify/delete them when needed. Continue reading “Angular Data Services, helped by the beauty of BehaviourSubjects (they are not BS)”

[Django] dumpdata to avoid conflicts and errors at loaddata

When you backup whole database by using dumpdata command, it will backup all the database tables.

If you use this database dump to load the fresh database(in another django project), it can be causes IntegrityError (If you loaddata in same database it works fine).

To fix this problem, make sure to backup the database by excluding contenttypes and auth.permissions tables.

./manage.py dumpdata --exclude auth.permission --exclude contenttypes > db.json

Long version, with natural primary and foreign keys:

manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e auth.Permission --indent 4