Re: urls

2011-07-14 Thread Massimiliano della Rovere
I think your case is #2 in https://docs.djangoproject.com/en/dev/topics/http/shortcuts/#redirect skype: masdero, icq: 473891447, yim: mas_dero, msn: mas_d...@hotmail.com Mi scriva in italiano; Write me in English; Skribu al mi Esperante! On Thu, Jul 14, 2011 at 10:13,

Re: Using Q objects vs explicit filters

2011-04-14 Thread Massimiliano della Rovere
what about Parent.objects.filter(~q) ? On Thu, Apr 14, 2011 at 11:08, Gianluca Sforna wrote: > On Wed, Apr 13, 2011 at 3:43 PM, Brian Bouterse wrote: >> Could you include the output to highlight the differences? > > I've just created a simpler test case.

Re: Creating REST APIs in Django...advice

2011-04-12 Thread Massimiliano della Rovere
https://bitbucket.org/jespern/django-piston/wiki/Home skype: masdero, icq: 473891447, yim: mas_dero, msn: mas_d...@hotmail.com Mi scriva in italiano; Write me in English; Skribu al mi Esperante! On Tue, Apr 12, 2011 at 10:07, Mazery Smith wrote: > Hello, >

AttributeError on _strptime_time

2011-03-10 Thread Massimiliano della Rovere
The error was trapped by django-sentry and does *not* occur in python interpreter, thus I can't understand it! Please can anybody enlighten me? Here the details: Exception Type: AttributeError Exception Value: _strptime_time The error is raised by line #698 in

Queryset using group_by on different fields than the ones in the aggregation function

2011-03-09 Thread Massimiliano della Rovere
We have this model in module X: class A(models.Model): when = models.DateTimeField() type = models.CharField(max_length=10) subtype = models.CharField(max_length=10) data = models.CharField(max_length=100) I am trying to do something like: SELECT MAX(when), type, subtype, data FROM x_a

Re: django, celery and mysql: Lost connection to MySQL server during query

2010-10-11 Thread Massimiliano della Rovere
of memory (Needed 8164 bytes) Out of memory (Needed 8164 bytes) Out of memory (Needed 8164 bytes) Looks suspiciously like a memory leak... On Sun, Oct 10, 2010 at 19:26, Erik Cederstrand <e...@cederstrand.dk> wrote: > > Den 10/10/2010 kl. 17.55 skrev Massimiliano della Rovere: >> &g

Re: django, celery and mysql: Lost connection to MySQL server during query

2010-10-10 Thread Massimiliano della Rovere
On Sun, Oct 10, 2010 at 17:12, Erik Cederstrand wrote: > > * Are you keeping a connection open to MySQL the whole time? I do not know what is the default behaviour of django, but I did not specify any custom option. > * What are the values of your timeout settings in the

django, celery and mysql: Lost connection to MySQL server during query

2010-10-10 Thread Massimiliano della Rovere
Using django 1.2.3 with celery 2.0.3 and django-celery 2.0.3 and mysql 5.1.41 on kubuntu 10.04, I receive the following error: OperationalError(2013, 'Lost connection to MySQL server during query'). The error occurs every time the task is executed and seems to be related to the execution time, in

OneToOneField in "Dynamic Model" referencing another dynamic model.

2010-07-18 Thread Massimiliano della Rovere
greetings. I am using the admin interface to show data retrieved by a collector process and put in a different table for each source; each source is identified by "cliente", "num1" and "num2". At run time django scans the db for tables with proper names and builds classes modeled from an abstract

Re: ModelAdmin,get_form or Field._get_val_from_obj

2010-07-13 Thread Massimiliano della Rovere
It seems that modifying context['adminform'].form.instance or obj in render_change_form has no impact on the rendered html. Where does the admin interface take the values to display from? On Tue, Jul 13, 2010 at 10:28, Massimiliano della Rovere <massimiliano.dellarov...@gmail.com> wrot

Re: ModelAdmin,get_form or Field._get_val_from_obj

2010-07-13 Thread Massimiliano della Rovere
e solution forces me to list all the possible values (usually less than 20 out of 255 are meaningful). Now I am trying the ModelAdmin.render_change_form On Tue, Jul 13, 2010 at 10:34, Daniel Roseman <dan...@roseman.org.uk> wrote: > On Jul 13, 9:28 am, Massimiliano della Rovere >

ModelAdmin,get_form or Field._get_val_from_obj

2010-07-13 Thread Massimiliano della Rovere
I need to "decode" the value of the fields of ModelAdmin.form so that, for some fields, the int value is translated in a string showing its meaning. I do not want to implement this in the Model class (using Model.to_python or Model.formfield for example), because the information displayed in the

Did anybody ever move the filter column (admin) on the left?

2010-07-12 Thread Massimiliano della Rovere
I know it's just messign with the css files, but there are a lot of lines marked with ".filter", not counting the grey border fo the main table when the filter list is taller than the "instances" box. I was wondering if anybody has a css files with the modified lines to include in the Media class

Re: Is Django admin's "delete confirmation" considered RESTful?

2010-07-08 Thread Massimiliano della Rovere
I did not read the sources of the admin module devoted to deleting an item, but I think the problem is not in the admin interface but in html forms. Html forms allow only GET and POST, but no DELETE and PUT. Given the REST common-sense rule "whenever you POST, ask the user" the admin interface -

Composite primary key (unique_together?) and ForeignKeys

2010-07-06 Thread Massimiliano della Rovere
Greetings, I am creating an event logger; each event spans in time from datetime to datetime. Each event is uniquely identified with the couple event_start_date_time and event_id (ranging from 0 to ). The Hardware event trapper automatically wraps the event_id. I am the programmer of the event

Re: Beginner nead help

2010-06-29 Thread Massimiliano della Rovere
I do not know whether there is or not the complete tutorial, but you can write the errors you receive or the doubts you have. They could be useful for other beginners too :) On Tue, Jun 29, 2010 at 10:54, Eduan wrote: > Hi all. I am a old Delphi programmer and started to

Re: How To Create POST data without an actual POST?

2010-06-29 Thread Massimiliano della Rovere
or you can use python urllib2: http://docs.python.org/library/urllib2.html On Tue, Jun 29, 2010 at 02:15, Gabriel Gayan wrote: > Maybe trying with ajax? > jquery has some nice functions to deal with ajax post requests. > You can even send files via ajax. > From the server

Re: Admin Search Engline

2010-06-28 Thread Massimiliano della Rovere
ould need to write > an expression parser and monkey around with the search code in admin. > > If you succeed, I'd be interested to see the result. > > Euan > > On Jun 28, 8:36 am, Massimiliano della Rovere > <massimiliano.dellarov...@gmail.com> wrote: >> I'd like to m

Admin Search Engline

2010-06-28 Thread Massimiliano della Rovere
I'd like to modify the default search engine in the django admin interface so that is can search metadata too like values depending on sql COUNT() using google style prefixes in these cases. Can somebody help me telling which class/method in the admin files is responsible for the search engine so

Re: Is there any kind of verbose_name for apps?

2010-06-17 Thread Massimiliano della Rovere
e and/or app-translations. > > you could use a 3rd-party-app like admin-tools to customize your index- > page and change appnames (see > http://bitbucket.org/izi/django-admin-tools/overview/). > > regards, > patrick > > On 16 Jun., 16:31, Massimiliano della Rovere >

Is there any kind of verbose_name for apps?

2010-06-16 Thread Massimiliano della Rovere
And if not how can I emulate that? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For

Re: Django + Ajax + Jquery

2010-06-07 Thread Massimiliano della Rovere
This is useful too: http://www.dajaxproject.com/ On Mon, Jun 7, 2010 at 07:57, Dmitry Dulepov wrote: > Hi! > > tazimk wrote: >>     I want to use ajax in my templates using jquery. >>     Can someone provide me some sample examples /links related to >> this. > >

Re: How to dynamically set limit_choices_to for ManyToManyField using values from an instance?

2010-06-04 Thread Massimiliano della Rovere
ou > want on the appropriate field (n), and then register that ModelForm > for admin use in your admins.py. > > Regards > Scott > > > On Jun 4, 6:14 am, Massimiliano della Rovere > <massimiliano.dellarov...@gmail.com> wrote: >> When displayed in the Admin inter

How to dynamically set limit_choices_to for ManyToManyField using values from an instance?

2010-06-04 Thread Massimiliano della Rovere
When displayed in the Admin interfaces, I'd like to filter the values of n, so that instances of N already linked to other instances of A sharing the same instance of o are not shown: so when you edit an instance of A (let's call it "a"), you see only the instances of n in use by a and the unsed

Re: Is there a way to add operations to an entity admin form?

2010-06-01 Thread Massimiliano della Rovere
here is how I added the action to create new items in the Addressbook (Rubrica) to the normal change list existing admin page: in admin.py class RubricaAdmin(admin.ModelAdmin): list_display = ('cognome', 'nome', 'numero_cellulare',) list_filter = ('cognome', 'nome',

Re: Is there a way to add operations to an entity admin form?

2010-06-01 Thread Massimiliano della Rovere
well you can do it with a minimal overhead... copy the django/contrib/admin/templates/change_form.html file to your project/templates/admin/ folder. The line with {% submit_row %} is what your are searching for: add whatever you need. Unisng the context parameter, pass to render_change_form

Re: Error

2010-06-01 Thread Massimiliano della Rovere
Greetings Bruxo, I do not speak Portuguese but being Italian I understood more or less your post. It seems you included "django.contrib.blog" in settings.py, but there is no "blog" module inside django.contrib. If "blog" is the name of the module you are developing, just add 'blog' (not

Re: Django 1.2.1 install in Ubuntu 10.04 via Synaptic?

2010-05-31 Thread Massimiliano della Rovere
or you can do the following tric: 1) install django sudo apt-get -y install python-django 2) now you have all the dependencies you need 3) sudo apt-get -y install python-setuptools 4) sudo apt-get remove python-django 5) sudo easy_install -Z django repeat step 5 after each release of django On

problem with admin tools 2.0 when dashboard.columns > 2

2010-05-19 Thread Massimiliano della Rovere
When I set Dashboard.columns to a value greater than 2, custom dashboardmodules are rendered narrower than they should appear and with lots of icons superimpressed. I am adding 1 DashboardModule and 2 LinkListDashboardModule-s to the CustomIndexDashboard using init_with_context. class

Override widget for one specific field in admin change_list page

2010-05-14 Thread Massimiliano della Rovere
I'm trying to override the widget used in the changelist page for one field of a model. The field is updated by an external daemon and is defined as: ping_status = models.CharField(blank=True, max_length=1, editable=False) The field will contains one letter: G = OK, R = KO, O = Suspect I created

Re: How to alter the value of a field in admin pages and turn off-autoescaping

2010-05-05 Thread Massimiliano della Rovere
calize(row.call_start))) x.allow_tags = True I still have to find out the solution to #1... On Wed, May 5, 2010 at 12:48, Massimiliano della Rovere <massimiliano.dellarov...@gmail.com> wrote: > 1st question) I am trying to change the way some of DateTimeField are > displayed in the change_list

How to alter the value of a field in admin pages and turn off-autoescaping

2010-05-05 Thread Massimiliano della Rovere
1st question) I am trying to change the way some of DateTimeField are displayed in the change_list page of the admin site (django 1.2 svn): how to do it? Not knowing which method to define or override in the ModelAdmin class, I opted for a different solution: I added a string in the list_display

Re: Admin custom filters

2010-05-04 Thread Massimiliano della Rovere
The filters are not documented. You can learn how they works, looking at the file DJANGO_PATH/contrib/admin/filterspecs.py I found DateFieldFilterSpec to be useful whenever you need to filter something that is in a range, not just for calendar matters. On Mon, May 3, 2010 at 23:23, Thales

Re: problem with apache and wsgi

2010-04-23 Thread Massimiliano della Rovere
does apache have the rights to open the file and enter the directories smedia and images? On Fri, Apr 23, 2010 at 10:45, Kenneth Gonsalves wrote: > hi, > > using django trunk on svn and the latest ubuntu with python 2.6. The setup is > this: > > MEDIA_ROOT = /home/user/media/

Dynamic Model and ModelAdmin based on tables in db

2010-04-22 Thread Massimiliano della Rovere
An external process creates tables whose names follow the pattern "collector_XYZ"; all the tables will have the very same structure. For each table I need to create a matching django.db.models.Model and django.admin.models.ModelAdmin, dynamically, because over time new tables will be created and

Re: Using external dbs... is django 1.2 the best solution?

2010-04-21 Thread Massimiliano della Rovere
My deadline is 26th, May Anyway the program will constantly grow so, yes I've just finished adding some modifications to make it run on Dj1.2 On Wed, Apr 21, 2010 at 12:49, David De La Harpe Golden <david.delaharpe.gol...@ichec.ie> wrote: > On 21/04/10 11:21, Massimiliano della Rov

Using external dbs... is django 1.2 the best solution?

2010-04-21 Thread Massimiliano della Rovere
I am developing a web site that has some of its models in a private database (the one specified in settings.py, populated by the admin interface) but, it has to fetch and filter (etc) data from 2 different databases that are populated (data is added but never modified or deleted) in real-time by

Is South 0.7.1 ready for django1.2?

2010-04-21 Thread Massimiliano della Rovere
I found nowhere information about compliancy of South 0.7.1 to the multiDB support of django 1.2 Did I overlook anything? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To

Re: I have a problem with the pagination with haystack and apache solr

2010-04-21 Thread Massimiliano della Rovere
What happens if you switch pagination off? On Mon, Apr 19, 2010 at 19:29, Ariel wrote: > Hi everybody: > I have a big problem with pagination using apache solr and haystack, this is > what it is happening: I have a site where the news are being indexing with > haystack and

Re: Giving up PHP. ...Can't decide between Django & Rails

2010-04-17 Thread Massimiliano della Rovere
Grok + zope3 could be a choice too. On Sat, Apr 17, 2010 at 05:39, hcarvalhoalves wrote: > Why do you have to "make a choice"? Learn both. They can be useful in > many different ways. > > I learned Rails (and Ruby) before Django, because I saw some material > for Ruby

Re: problems with FormWizard

2010-04-16 Thread Massimiliano della Rovere
it should be! Could it be a server caching issue? On Fri, Apr 16, 2010 at 18:30, Massimiliano della Rovere < massimiliano.dellarov...@gmail.com> wrote: > I am resendin this email with dots instead of tabs in python code to > overcome the automatic formatting of gmail > sorry for the diu

Re: problems with FormWizard

2010-04-16 Thread Massimiliano della Rovere
I am resendin this email with dots instead of tabs in python code to overcome the automatic formatting of gmail sorry for the diuplication ;) My form wizard is initially composed of 2 forms. In form1 the users selects an event he wishes to attend to, enters his name and surname etc and how

problems with FormWizard

2010-04-16 Thread Massimiliano della Rovere
My form wizard is initially composed of 2 forms. In form1 the users selects an event he wishes to attend to, enters his name and surname etc and how many guests he will bring form2 tells how to pay, but it is a template / dummy form, necessary because I do not want the form wizard to end after

Re: Django SMTP and SPA

2010-04-14 Thread Massimiliano della Rovere
()) server.quit() On Wed, Apr 14, 2010 at 11:26, Alex <akimov.a...@gmail.com> wrote: > No. > I've just googled a bit for SPA, SPA+python. But I did not find > anything helpfull. > > On 13 апр, 18:44, Massimiliano della Rovere > <massimiliano.dellarov...@gmail.com> wrote:

Re: Django SMTP and SPA

2010-04-13 Thread Massimiliano della Rovere
i think the python modules - smtplib - email will help. Have you already tried these ones? On Tue, Apr 13, 2010 at 14:58, Alex wrote: > Hi. > Can anybody suggest an idea how to deal with SMTP server with Secure > Password Authentication in Django? > > -- > You received

How to integrate a two step admin-action in the admin pages layout

2010-03-29 Thread Massimiliano della Rovere
I am writing a two step admin action: 1) select the items you want to mass-modify and click the action 2) enter the values that will be processed for each selected item 3) finally go back to the item list page with a user_message informing her/him about the outcome. I am trying to create a

Re: Row Level Permissions?

2010-03-11 Thread Massimiliano della Rovere
Row Level Permissions work perfectly: http://code.djangoproject.com/wiki/RowLevelPermissions On Thu, Mar 11, 2010 at 14:21, Rodrigo Cea wrote: > What's the current state of the art for Row Level Permissions? > > I need to set permissions for users on a MPTT-based page

Re: Looking for a wiki or cms created with django

2010-02-24 Thread Massimiliano della Rovere
no it is just at pre alpha status. if you are searching for something in python, head towards OpenErp else vtiger + media wiki us a solution or as soon as we will resolve our problems here with migration from sugar to vtiger, I will start writing a crm in django (or grok+zope3) tailored

Any CRM based on django?

2010-02-19 Thread Massimiliano della Rovere
At work we are planning move from Sugar CRM PRO to something else free. I'd love moving to something python based, but it seems the only free and reliable solution is VTiger 5 written in php. Does anybody here know any CRM based on django? -- You received this message because you are subscribed

Re: AJAX Autocompletion Field

2010-02-15 Thread Massimiliano della Rovere
I'd use http://dajaxproject.com/ On Sun, Feb 14, 2010 at 06:36, Margie Roginski wrote: > Hi Jon, > > I have used this very successfully: > > http://loopj.com/2009/04/25/jquery-plugin-tokenizing-autocomplete-text-entry/ > > The demo is here: > >

Re: "Pro Django" book still up to date

2010-02-01 Thread Massimiliano della Rovere
Hi Achim, the book, as many told you, is for Django 1.0 The book content is not outdated, at least with django 1.1 The meat of the book are insights about django structure, how components work together and hidden movements behind the scenes you could exploit or hook to. It'snot a beginner's

Re: Meta.widgets in ModelForm seems... ignored

2010-01-27 Thread Massimiliano della Rovere
ondo > > I am not sure if this works. > > > > 2010/1/26 Daniel Roseman <dan...@roseman.org.uk> >> >> On Jan 26, 11:45 am, Massimiliano della Rovere >> <massimiliano.dellarov...@gmail.com> wrote: >> > I use django 1.1.1 and I defined: >> &

Meta.widgets in ModelForm seems... ignored

2010-01-26 Thread Massimiliano della Rovere
I use django 1.1.1 and I defined: class Fondo(models.Model): denominazione = models.CharField(max_length=200) storia= models.TextField(blank=True) class FondoForm(forms.ModelForm): class Meta: model = Fondo widgets = {'storia': forms.TextInput} but the 'storia' field is still shown

view_form for class ModelAdmin

2010-01-21 Thread Massimiliano della Rovere
Has anybody ever implemented an extension to class ModelAdmin to add "view_form" function and templates? I'm in a situation where the logged user can list both draft and published files. With ModelAdmin.queryset i filter the files the user is allowed to list in "change_list" view, but those files

Re: Admin site pages + display or hiding instance owner field

2010-01-20 Thread Massimiliano della Rovere
Solved. It seems this is due to the 1.2 alpha1 bug involving form.is_valid(): http://www.pubbs.net/django/201001/16447/ reverting to django 1.1 solved all my problems On Wed, Jan 20, 2010 at 10:25, Massimiliano della Rovere < massimiliano.dellarov...@gmail.com> wrote: > Ok I managed

Re: Admin site pages + display or hiding instance owner field

2010-01-20 Thread Massimiliano della Rovere
Ok I managed to remove the compilatore field from the form (this RowModelAdmin class is used by many Models, all having the compilatore field) def get_form(self, request, obj=None, **kwargs): form = super(RowModelAdmin, self).get_form(request, obj, **kwargs) if not request.user.is_superuser: del

Re: Admin site pages + display or hiding instance owner field

2010-01-19 Thread Massimiliano della Rovere
Thanks for your answer Tim. def get_form(self, request, obj=None, **kwargs): form = super(RowModelAdmin, self).get_form(request, obj, **kwargs) if not request.user.is_superuser: * **del form['compilatore']* return form It seems that the object returned by get_form does not behave like a

Admin site pages + display or hiding instance owner field

2010-01-19 Thread Massimiliano della Rovere
Is there a way to show or hide a model field in a admin site "change" page depending upon the value of request.user.is_superuser ? I was thinking about filling ModelAdmin.field or .fieldset depending on the value of request.user, but how to read the value of request in ? Also .readonly_fields when

Re: Admin pages, filtering instance list by instance field value and a newbie (me)

2010-01-19 Thread Massimiliano della Rovere
Solved: I found this (well hidden) page: http://code.djangoproject.com/wiki/RowLevelPermissions I do not know it is not embedded in Admin.site documentation... and why those fully functional methods are simply hidden in the source code... On Tue, Jan 19, 2010 at 10:00, Massimiliano della Rovere

Re: Admin pages, filtering instance list by instance field value and a newbie (me)

2010-01-19 Thread Massimiliano della Rovere
In simpler terms: is there a way to filter instances shown with "admin" pages considering the logged user id? is there a way to "interface" request.User with admin.ModelAdmin ? On Mon, Jan 18, 2010 at 22:33, Massimiliano della Rovere < massimiliano.dellarov...@gmail.c

Admin pages, filtering instance list by instance field value and a newbie (me)

2010-01-18 Thread Massimiliano della Rovere
Greetings, I'm here to seek your help: I'm new to Django (I have experience with Prado and Zope3 though). Here is my problem: I created a model having - among the other ones - a status field (approved, draft, proposed, etc) and a reference to the user that created the instance. I'd like to use