[GSoC] Dynamic, rule-based ModelForms

2014-03-05 Thread Paolo Coffetti
Hi Django devs,

I want to share an idea with you and get some feedback in order to know if 
it makes sense, if it could solve a common problem and maybe evolve into an 
official GSoC proposal.

Some years ago I was working on a printing on demand website using Django 
1.2 and some model forms.
Our front-end guy designed a HTML form that had:
 - A *paper type*  tag with options: A4, A5
 - A *color*  tag with options: B&W, COLORS
The form must follow some business rules:
 - B&W available only for A4
 - COLORS available only for A5
(actually the original problem was a bit more complicated, but I'll keep it 
short...)

The solution I adopted was made of the following components.
 - A classic Django *model* and a *ModelForm* to manage and render the *paper 
type* and *color* form fields.
   Plus a Django *model* to implement the 2 rules.
 - A minimal *Javascript* code to detect an interaction of the user with 
the *paper type* or *color* field: when the user changed the selected value 
of *paper type* to f.i. A4, the entire form was sent back to Django using a 
AJAX request.
 - After receiving the edited form, Django checked the rules, disabled the 
unavailable options, COLORS in our case (by setting COLORS), rendered the form to HTML 
and sent it back to the AJAX request.
   This behavior was implemented with a custom *form widget*.

With this solution users had a clear visual feedback on what the rules were.

Do you think this was a good design? Is there a better solution nowadays? 
Do you believe this could be a solution to a common problem? Could this 
idea evolve to a GSoC proposal (from myself of course)? Or maybe this idea 
is more likely a third-party library so it does not fit GSoC?
And about GSoC: this idea could maybe go together with the suggested 
"Finishing off Form Templates", which actually challenges me, but scares me 
at the same time since I'm not super experienced, plus the idea is marked 
as hard and someone already failed last year...

PS: That printing on demand website website is still up and running, so if 
I couldn't manage to be clear enough, I can link it here (I haven't done it 
because I don't want to spam)

Cheers,
Paolo

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/93f058ca-ba15-46ab-b49c-35b62c61f712%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [GSOC] Django-based project for the neuroinformatics community: neurostars.org

2014-03-06 Thread Paolo Coffetti
Hi Roman,

I'm a software engineer currently working on my master thesis. I've been 
working with Python and Django for some years, in particular in the Open 
Access field, and I'm interested in NeuroStars project. Give me a day to 
read more about it and formulate my idea, then I will contact you again!

Cheers,
Paolo

Il giorno giovedì 6 marzo 2014 13:53:12 UTC+1, Roman Valls Guimerà ha 
scritto:
>
> Hello Django-ers,
>
> I have been wondering if it would be appropiate to announce this here, but 
> since it's about Django and GSoC I thought about giving it a try, excuse me 
> if it's not.
>
> At http://incf.org, we launched a Stackoverflow-like website to engage 
> the neuroscientific community, you can have a look at some ideas we came up 
> with if someone is interested:
>
>
> http://www.incf.org/gsoc/2014/proposals/#neurostars--a-question-and-answer-site-for-the-neuroinformatics-community
>
> We are still open for student proposals, feel free to contact me if you 
> need more details!
>
> Best regards,
> Roman
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/489c13aa-c9ba-47a7-be48-12f642fb84df%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[GSoC] Security Enhancements; Reducing coupling in Django components

2014-03-09 Thread Paolo Coffetti
Dear Russell, PaulM and Django-devs,

I'm Paolo Coffetti, a software engineer living in Amsterdam, the 
Netherlands.
I'm very close to a master degree at University of Bergamo, Italy: I've 
finished all the courses and currently working on my thesis which I'll be 
defending on June 9.
The thesis is about a project which I temporarily named Moogle (My Own 
Google). Moogle is a website with a full text search engine for private 
data: it connects to a user's accounts in Facebook, Twitter, Google (Drive, 
Gmail, Google Plus) and Dropbox, indexes all her data (only textual 
information) and provides a private full text search (available only to 
her). The project is not complete yet, but I'm working hard.

I've been working in Amsterdam in a small startup company named United 
Academics since 2010 as web developer. Officially I'm not working for them 
anymore because I'm 100% focused on my thesis, but from time to time I 
still help their IT team.
United Academics is a company which aims today to provide an Open Access 
repository to scientists, but unfortunately is lately facing some financial 
difficulties. In the last years United Academics was something slightly 
different and I worked on projects like a printing on demand website 
(www.print2book.com), a job portal (now offline), a bookstore (now 
offline), a couple of Wordpress websites 
(http://www.united-academics.org/magazine/) and more recently an Open 
Access repository (not online yet). All those projects (apart from the 
Wordpress ones) were made in Python and Django so I consider myself an 
expert with those technologies. I'm definitely not a senior cause I still 
have a lot to learn, but I'm also definitely more than a junior.

I spent some hours during the last days on Django's proposals for Google 
Summer of Code.
I'm particularly interested in: Security Enhancements and Reducing coupling 
in Django components.
I've got a good impression reading those ideas and I would like to ask you 
more details.
This is not my official proposal, I haven't deeply studied the codebase 
yet, nor made a detailed plan, but only a first approach in order to get a 
clearer idea on what the aims are and see if I am on the right track.
Also, I've never contributed to Django's code and, even tho I know Python 
quite well, all those ideas sound quite tough to me and I'm wondering if 
I'm good enough.



*Reducing coupling in Django components*

This is the idea I'd appreciate the most as Django user. Having the 
possibility to use only the template engine or the ORM or the form layer 
could be useful for many projects (I will give an example later).
Anyway it is not clear to me if this idea is more about 
refactoring/reorganizing dependencies among modules in order to decouple 
parts of the system or if it is more about packaging.

*Packaging part*
Honestly I don't know much about packaging best-practices; I did some 
research today but it's not even clear to me whether Django uses Setuptools 
or Distutils.
Anyway looking at the tickets for the packaging component I found something.

https://code.djangoproject.com/ticket/18937
It's about adding metadata to Python distributions as described in PEP345, 
but actually as jezdez says "it's easy enough to put the info in a 
setup.cfg as it's implemented by distutils2/packaging... On the other hand 
as long as distutils2/packaging isn't official released/included in Python 
3.X it may be senseless to do so."

https://code.djangoproject.com/ticket/21108
Make pre-release installable via pip

*Refactoring dependencies part*
I guess this part requires a good overview on the entire system, which I 
don't have. But I have a great understanding of object oriented principles 
in Python and this could be useful.

So in the end, in order to complete this task I would need a great guidance 
cause it's even hard to me to define what exactly are the activities to be 
done, estimate and prioritize them. I could for instance start with a 
single component like the ORM and clean it up.
I investigated a little bit and django/db currently has the following 
dependencies: dispatch, apps, core, forms, utils.
I actually feel very challenged by this activity, it looks like I can 
really learn a lot by looking into the core of Django and I don't mind to 
work hard!

Plus I have an idea, not sure whether it is pertinent tho.
I'm working on a project which has, among the others, 2 parts:
- a Django website which has a database with OAuth tokens (and many other 
things)
- some Python code which uses the same OAuth tokens to do some batch 
operations 
The 2 parts are independent sub-systems and they are deployed to different 
machines; but both parts must be able to read/update the same set of OAuth 
tokens.
One solution would be using the ORM provided by Django and the same models 
in the