A
A
Alexey Berdnikov2011-12-27 18:37:56
Django
Alexey Berdnikov, 2011-12-27 18:37:56

Questions about Django

I have not been interested in the development of the framework for a year, I would like to know from those who actively use it - whether the following questions were resolved in a year (albeit in the form of third-party, but normally working applications), to which I did not find an answer at one time:
1) automatic assembly of statics (for PHP I made such a module) habrahabr.ru/blogs/kohanaphp/112852/
2) validation in one place (server and client) when you specify a rule and it generates code for client validation jquickform.aberdnikov.ru/?page=rules_required
is library fork pear.php.net/package/HTML_QuickForm2/
3) problem with users (profile extension), at one time there was a battle right for django mankipatching vs using a profile as an integral part of the user model

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Sardar, 2011-12-28
@Sardar

> automatic build of statics
django-staticfiles is integrated into the core framework. Now ./manage.py collectstatic collects static from all applications in one place. Everything is configurable.
> validation in one place (server and client)
Not in the standard framework.
> problem with users (profile extension)
Now you can bind an arbitrary model with a reference to User as a profile. Although there were no inconveniences in this regard before, were there?

K
kmike, 2011-12-28
@kmike

As for 3 - I recommend linking profiles through OneToOneField or AutoOneToOneField: this is a fairly transparent and simple scheme (unlike inheritance), profiles can be accessed through user.profile1 and so on, + choose what you need and when you need it using select_related (again , no implicit queries like with inheritance). Moreover, get_profile () and AUTH_PROFILE_MODEL (or whatever) is unclear even why to use it, rather there is no need.

M
Mark, 2011-12-28
@printf

On the second point - I saw some solution, but did not use it.
The rest works as Sardar wrote above.

A
admin4eg, 2011-12-28
@admin4eg

What's wrong with the profile extension?
I'm kind of still quite new to django, but everything seems to have turned out like this
www.odmin4eg.ru/2011/rasshirenie-profilya-polzovatelya-django/

G
Gasoid, 2011-12-28
@Gasoid

3) yes, it’s inconvenient, user.get_profile().some_field for extended fields is somehow not as interesting to use as just user.email

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question