We love sharing our knowledge and experience
These are some of our thoughts on technology and business processes, as well as our inner workings and developer lifestyles.
- all
- Alexandr Selyanov
- Alexey Demianenko
- Anastasia Kryzhanovska
- Anna Ianushenko
- Anna Sydorenko
- Anton Kozachok
- Anton Lysenkov
- Denis Untevskiy
- Emma Khomits
- Igor Bolotnikov
- Igor Tokarev
- Kateryna Chegodaeva
- Maryna Sharapova
- Mikhail Andreev
- Mykola Korovenko
- Mykyta Miazin
- Nataliya Yaremenko
- Nikolay Budnikov
- Oksana Mirgorodskaya
- Oleksandr Lebid
- Oleksandr Oliinyk
- Pasha Volkov
- Rostyslav Stekh
- Viktor Tyshchenko
- Vlada Oliinyk
- Volodymyr Kalyuzhnyi
- Volodymyr Sydorenko
- Yurii Mironov
There was a task to submit form with ajax, with server side validation of course. Obvious solution is to do validation and return json with erros. I didn't like idea of writing separate view for validation and then inserting errors in form html on client side. Especially since I already had a generic template for django form with errors display. In this article I'll describe how I solved the task.
In UNIX way, each view should solve single task. This is good idea, but sometimes we need to mix logic of different views on same page. Filter, sort, paginate, or, for example, add comment on product page. In this article I'll show how we can mix such multiple views.
In my recent project there was a lot of data business logic, so I had to organize this code somehow. In this article I'll describe a few hints on how to it.
Usually users' profiles are stored in single model. When there are multiple user types, separation is made by some field like user_type.Situation is a little more complicated when different data is needed for each user type.In this article I'll describe how I solve this task.
Everybody knows about permalink, but it's usually used only in get_absolute_url. I prefer to use it for all related model urls.class Event(models.Model):# ...@models.permalinkdef edit_url(self):return ('event_edit', (self.pk, ))And then in template:<a href="{{ event.edit_url }}">Редактировать событие</a>
