Maps with Django

2020-12-08 Thread Paolo Melchiorre
paulox.net/2020/12/08/maps-with-django-part-1-geodjango-spatialite-and-leaflet/ See you, Paolo -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email

Re: django 2.0 tutorial :: exception:: application labels are not unique.

2018-05-16 Thread Paolo Chilosi
it knows what configurations to load. > > On Tue, May 15, 2018 at 7:27 AM Paolo Chilosi > wrote: > >> thanks for pointing out about the typo. However this was not the cause of >> the exception. Look to my previous answer. >> >> >> On Tuesday, May

Re: Standard approach

2018-05-16 Thread Paolo Chilosi
It will be helpful to have a group/blog for Django beginner so we could share problems and solution, maybe this group is geared for more advance users. On Tuesday, May 15, 2018 at 7:53:58 PM UTC-4, Mike Dewhirst wrote: > > This list gets a lot of new people joining. They come from all cultures

Re: django 2.0 tutorial :: exception:: application labels are not unique.

2018-05-15 Thread Paolo Chilosi
thanks for pointing out about the typo. However this was not the cause of the exception. Look to my previous answer. On Tuesday, May 15, 2018 at 9:44:57 AM UTC-4, Sidyvan Fernandes de Andrade wrote: > > python manage.py makemigrations polls > > 2018-05-15 8:51 GMT-03:00 P

Re: django 2.0 tutorial :: exception:: application labels are not unique.

2018-05-15 Thread Paolo Chilosi
; > *From:* django...@googlegroups.com [mailto: > django...@googlegroups.com ] *On Behalf Of *Paolo Chilosi > *Sent:* Tuesday, May 15, 2018 6:52 AM > *To:* Django users > *Subject:* django 2.0 tutorial :: exception:: application labels are not > unique. > > > > As new to Django I am l

django 2.0 tutorial :: exception:: application labels are not unique.

2018-05-15 Thread Paolo Chilosi
As new to Django I am learning following the tutorial carefully. When I reached the point of making the migration for the polls app I executed (from the PyCharm terminal) the command: (venv) C:\Users\Paolo\PycharmProjects\mysite>python manage.py makemigration polls and then I obtained

DjangoCon Europe 2017

2017-05-06 Thread Paolo Melchiorre
/851110007190016002 I created also a group on flickr to share photo from everyone: https://twitter.com/pauloxnet/status/853352614255366146 I hope you would appreciate it, Paolo -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Re: Advanced Annotate

2015-09-16 Thread Paolo C.
Hi Carsten, my problem is slightly different, in your example you wanted to annotate for example the max_book price, I need to annotate not only the price but also which is the book that has that max value. Thanks -- You received this message because you are subscribed to the Google Groups

Advanced Annotate

2015-09-14 Thread Paolo C.
I've posted this issue on Stackoverflow Given this model: from django.db import models class Post(models.Model): text = models.CharField(max_length=255) class Comment(models.Model): text = models.CharField(max_

Re: Avoid Django s3-urls stripping

2014-03-31 Thread Paolo Bertasi
t the URL into pieces, to see if > it's some specific characters that it's choking on, and then just send > me that bit. > > Otherwise, if you'd like to create a small example project that > demonstrates this issue, and upload it to github, that would work as &

Re: Avoid Django s3-urls stripping

2014-03-28 Thread Paolo Bertasi
picture. From there, I would start narrowing it down, to > > see if it was a specific character that was causing the problem. > > > > Narrowing things down a bit more might make it easier for folks to > > help you figure out your issue. > > &g

Re: Avoid Django s3-urls stripping

2014-03-27 Thread Paolo Bertasi
scaped? > > Just a guess. > > Aaron > > On 3/21/14, Paolo Bertasi > wrote: > > Hello, > > I'm trying to setup a mini django app to allow users to download files > from > > > > s3. I wrote a simple python function (using boto of course) to fet

Avoid Django s3-urls stripping

2014-03-21 Thread Paolo Bertasi
Hello, I'm trying to setup a mini django app to allow users to download files from s3. I wrote a simple python function (using boto of course) to fetch the correct url but when i handle the url with django the url is stripped. I wrote down the exact behaviour here

Managing existing UI

2013-11-01 Thread Paolo Giannoccaro
Hi All, which are the best practices while developing a full Django app (version 1.5, Phyton 3) starting from an existing html UI ? The template approach is still valid ? In this case which is the impact over existing html UI ? Many thanks -- You received this message because you are subscribed

Testing: Fixtures vs Factories vs ???

2012-02-17 Thread Paolo
Hi folks, I've been coding away on my latest Django project, and have recently started to think about how best to test the functionality I have so far. Creating fixtures for my tests seems like a good idea initially, but from experience I find fixtures become harder and harder to maintain as th

OneToOneField causes NotFound exception?

2011-10-24 Thread Paolo
Hi, It looks like if I'm using a OneToOne field (with blank=True etc set) and happen to try and access this field when it's Null (or None) then I get a NotFound exception? My expectation was it would return None of nothing was set, not raise an exception? I could of course catch this except

Re: Django ORM - Am I trying to do the impossible?

2011-10-21 Thread Paolo
Hi Jirka, Thanks for the response, but if I understand your post then the issue is still the need to iterate over every Team (as opposed to every assignment) in order to construct a collection of Teams in a certain Status... if that makes sense. I think the crux of the issue is a limitation of

Re: Django ORM - Am I trying to do the impossible?

2011-10-21 Thread Paolo
Thanks guys, I think you're essentially saying the same thing in different ways - 'denormalise' the data so I can make use of the Assignment model for querying without looking at the Update models. This clears things up for me, cheers! -- You received this message because you are subscribed t

Re: Django ORM - Am I trying to do the impossible?

2011-10-21 Thread Paolo
An additional requirement for assignments is to keep status history, so we can see "assignment 1 was active mon-wed, standby thu-fri then active again" etc. As for the query, yes that was my initial idea but I thought it was going to be inefficient for times when I wanted to query for all assig

Django ORM - Am I trying to do the impossible?

2011-10-20 Thread Paolo
Hi all, I'm developing a Django app that has a slightly complex model, as follows: Teams have Assignments, which in turn have Assignment Updates. The status of the Assignment (and therefore the Team) is based on the latest Assignment Update, which has a status of ACTIVE, STANDBY etc. My issue

Re: DatabaseError: ORA-03127: no new operations allowed until the active operation ends

2011-03-22 Thread Paolo Corti
On 22 Mar, 11:41, Paolo Corti wrote: > Hi > I had to migrate a GeoDjango project based on a Postgres/PostGIS > backend to a Oracle/Oracle Spatial backend. > > I could sync the database without problems and now I can successfully > read and create new data from the shell, but a

DatabaseError: ORA-03127: no new operations allowed until the active operation ends

2011-03-22 Thread Paolo Corti
the active operation end I am having the same behavior both with Django 1.2.5 and 1.3 RC any ideas? thanks -- Paolo Corti Geospatial software developer web: http://www.paolocorti.net twitter: @paolo_corti -- You received this message because you are subscribed to the Google Groups "Djang

Pre-filled user info in Django Comments?

2010-12-09 Thread Paolo
Hi, The site I'm building uses the standard user management framework and the standard comments framework. What I'd like to see happen is the comments form rendered with the user's name and email address pre-filled if they are already signed in (or have the fields hidden entirely!). Easy enough?

Custom manager on abstract model

2009-09-01 Thread Paolo Ferretti
o use the elegant solution! Any ideas to solve this problem? Thanks, Paolo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@google

Re: Update an object with a dictionary

2009-06-10 Thread Paolo Corti
> > .save() is only for persisting the object to disk, not for modifying > objects. To update any Python object from a dictionary is as easy as: > > for k,v in d.items(): setattr(myobject, k, v) this is also what i came to. But curious to try the Daniel's approach, will let you know best regards

Update an object with a dictionary

2009-06-10 Thread Paolo Corti
r to delete and create the object again using the dictionary, is there a best approach? thanks Paolo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: How can i access UserProfile from User in the views?

2009-03-18 Thread Paolo Corti
e, blank=True, null=True) so looks like in the doc should be written that the foreign key MUST be called user. thanks anyway Paolo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To p

Re: How can i access UserProfile from User in the views?

2009-03-17 Thread Paolo Corti
Hello Andy > > Do you mean in the template? yes, sorry... > > I don't use Django templating but have you tried: > > user.get_profile.home_address > if i use this in the template i get this error: Caught an exception while rendering: Cannot resolve keyword 'user' into field thanks anyway

How can i access UserProfile from User in the views?

2009-03-17 Thread Paolo Corti
Hi I know is easy to access to the UserProfile, like here: from django.contrib.auth.models import User u = User.objects.get(pk=1) # Get the first user in the system user_address = u.get_profile().home_address but is there a way to access to UserProfile in the view? supposing the UserProfile mode

Re: link to ForeignKey in Admin's change list page

2008-11-18 Thread Paolo Corti
Daniel, thanks a lot, it works perfectly Paolo On Nov 17, 8:19 pm, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Nov 17, 4:42 pm, Paolo Corti <[EMAIL PROTECTED]> wrote: > > > > > Hi > > maybe this is trivial, but i can't find a way to get it (and from

link to ForeignKey in Admin's change list page

2008-11-17 Thread Paolo Corti
Hi maybe this is trivial, but i can't find a way to get it (and from what i can see it seems not possible): my model: class Project(models.Model): name = models.CharField('name', max_length=255) #relationship projectowner = models.ForeignKey(Person) in admin

verbose_name_plural not working in the admin?

2008-09-09 Thread Paolo Corti
min interface, the link to the change page is displayed as "Tipo di Misuras". Is it a bug or am i missing something? thanks in advance Paolo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users

Re: Unicode decode errors with Admin and Postgres

2008-09-09 Thread Paolo Corti
write a __unicode__ > method for your model (not a __str__ method). Refer to the first two > sections here (or the /unicode documentation) for > details:http://www.djangoproject.com/documentation/model-api/#str > > And, yes, those secti

Unicode decode errors with Admin and Postgres

2008-09-01 Thread Paolo Corti
just created from the admin interface: http://localhost:8000/admin/apptestutf/person/6/ I get this error: TemplateSyntaxError at /admin/apptestutf/person/6/ Caught an exception while rendering: 'ascii' codec can't encode character u'\xe8&#x

Unicode decode errors with Admin and Postgres

2008-09-01 Thread Paolo Corti
cess the object I just created from the admin interface: http://localhost:8000/admin/apptestutf/person/6/ I get this error: TemplateSyntaxError at /admin/apptestutf/person/6/ Caught an exception while rendering: 'ascii' codec can't encode character u'\xe8&#x

Re: memcache not used?

2008-07-01 Thread Paolo Ambrosio
Hi, just a quick note... the port (112211) wrong only on your email, or in the settings file too? > CACHE_BACKEND = 'memcached://127.0.0.1:112211/' Paolo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

Re: possible urls issue

2008-06-30 Thread Paolo Ambrosio
view you chose for '^step2/' in your urls.py Paolo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To un

Re: Trying to get ifequal to evaluate to True

2008-06-30 Thread Paolo Ambrosio
On Mon, Jun 30, 2008 at 5:14 PM, Ayaz Ahmed Khan <[EMAIL PROTECTED]> wrote: > > On Jun 30, 8:05 pm, "Paolo Ambrosio" <[EMAIL PROTECTED]> > wrote: >> On Mon, Jun 30, 2008 at 4:52 PM, Ayaz Ahmed Khan >> >> <[EMAIL PROTECTED]> wrote: >>

Re: Trying to get ifequal to evaluate to True

2008-06-30 Thread Paolo Ambrosio
On Mon, Jun 30, 2008 at 4:52 PM, Ayaz Ahmed Khan <[EMAIL PROTECTED]> wrote: > [...] The variable "next" > does have that particular value (I verified both by printing it out > and by making sure {% if next %} evaluates to True). However, the > "ifequal" expression just doesn't work. Are you pa

Re: possible urls issue

2008-06-30 Thread Paolo Ambrosio
if you want to redirect the request to another url you have to use HttpResponseRedirect, since render_to_response simply uses the step2.html template to render the page (so no http redirect). AFAIK it should be also explained in the Django tutorial. Hope it helps. Paolo --~--~-~--~~-

File Upload with newforms

2008-03-10 Thread Paolo Ferretti
I've got a problem with file upload in django. I found some generic documentation like this: http://www.djangoproject.com/documentation/model-api/#filefield http://www.djangoproject.com/documentation/faq/#how-do-i-use-image-an... Reading that pages, I suppose that the file uploading copy into my

Use properties for filtering results

2007-04-11 Thread Paolo Dina
In my model there is model method I'd like to use for filtering. Is it possible? I have put it in form of property, but when I use it with field lookup syntax I get an error. This is a minimal sample model that should explain what I mean: class Category(models.Model): name = models.CharField

Re: Upload to custom directory

2006-09-12 Thread paolo
Hi, search the list for ImageField or FileField and you will find some useful answer to your question, together with other side effects about these fields that is good to know. Other people have had your same problem (and actually me too), and some of them offered their solution. Example: http://g

Re: Italian Documentation

2006-09-10 Thread paolo
> 2. In the page you mentioned I saw that tutorial part 1 italian is > already finished by you > so mine would be a "surplus". From now on I will check the page > before any translation start. Hmm rather than a "surplus" it is just another translation of the same document (and that was one of th

Re: Italian Documentation

2006-09-08 Thread paolo
rent Django release and 1.0? Look here: http://www.djangoproject.com/documentation/api_stability/ Paolo P.S. Please, next time could you please create a dedicated thread when ask different questions? Thanks. --~--~-~--~~~---~--~~ You received this message becaus

Re: Italian Documentation

2006-09-08 Thread paolo
h and easy. Paolo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL

Re: mod_python Segmentation fault importing django.utils.feedgenerator.py - with fix

2006-02-16 Thread paolo
Hi, I had problems running Django with mod_python, so I had the possibility to investigate and obtain some detailed info, which I'd like to share here. I'd like to suggest "Expat Causing Apache Crash", which explains problems caused due to mismatches in the version of the "expat" library embedded

Re: Help running Django with mod_python

2005-12-02 Thread Paolo
2005/12/2, frank h. <[EMAIL PROTECTED]>: > > hej paolo, > I am on OS X as well, and I had problems with Apache and mod_python. Hi frank, I'm not running OS X! I looked at django's documentation and at http://cavedoni.com/2005/django-osx, as you suggested, but even tr

Re: Help running Django with mod_python

2005-12-02 Thread Paolo
2005/12/1, Bryan Murdock <[EMAIL PROTECTED]>: > Do you have mod_php running too? See this: > > http://www.modpython.org/pipermail/mod_python/2004-January/014886.html No mod_php installed! I already checked that (and this faq gives an explanation about mod_php and mod_python incompatibilities in

Re: Help running Django with mod_python

2005-12-02 Thread Paolo
2005/12/1, Afternoon <[EMAIL PROTECTED]>: > Have you tried adding PythonDebug On to your httpd.conf? Also, I'm > using SetHandler python-program, no idea if that makes any difference > though. Yes, PythonDebug is On, and to increase verbosity LogLevel is set to value debug. For mod_python 3.1, i

Re: Help running Django with mod_python

2005-12-01 Thread Paolo
html/inst-testing.html), happens without problems. This make me think that apache/mod_python/python installation is fine and that the problem is in httpd.conf or in my project. So I'll post them. This is the relevant part of httpd.conf: DocumentRoot /home/paolo/projects/django Se

Re: Help running Django with mod_python

2005-12-01 Thread Paolo
2005/12/1, Afternoon <[EMAIL PROTECTED]>: > > > On 1 Dec 2005, at 14:29, Paolo wrote: > > > [Thu Dec 01 11:07:13 2005] [notice] child pid 15299 exit signal > > Segmentation fault (11) > > Ah, I spent a frustrating few hours wrestling with this error (or one

Help running Django with mod_python

2005-12-01 Thread Paolo
I'm trying to setup Django with Apache and mod_python. I have followed the procedure described in the document "how to use Django with mod_python", but I can't obtain a working basic (single Django installation on the same Apache) environment, because Apache unexpectedly crashes at each request.

Re: Standalone template language

2005-11-24 Thread paolo
The first import in django/core/template/__init__.py wants to obtain DEFAULT_CHARSET and TEMPLATE_DEBUG from the settings file. Being DJANGO_SETTINGS_MODULE not set, an EnvironmentError exception is raised. If you handle this exception with try/except, defining yourself default values for DEFAULT_

Re: Standalone template language

2005-11-24 Thread Paolo
2005/11/24, Cheng Zhang <[EMAIL PROTECTED]>: > > It's possible, based on my limited knowledge of Django. I think such > usage is more like using a Python library. > In your case, you need to set the environment variable > DJANGO_SETTINGS_MODULE as shown in tutorial 1, e.g. export > DJANGO_SETTINGS

Standalone template language

2005-11-24 Thread paolo
I wonder if it's possible to use Django's template engine outside of Django. I tried to import Template from django.core.template but Python interpreter complains about undefined DJANGO_SETTINGS_MODULE. Thanks

Re: Help using POST to pass values

2005-10-25 Thread paolo
It works now! Sorry but I didn't find that page. Thanks a lot, Sune.

Help using POST to pass values

2005-10-25 Thread paolo
Hi, since today I've used the admin interface as a frontend for my applications' data, but now I'm trying to do a simple query interface by my own. I need some help figuring how to pass values through requests. Actually the frontend consists of two pages: page A contains a form where the user may

About _post_save

2005-10-06 Thread paolo
Hi! I'm trying to use _post_save hook. How to distinguish if an object has been saved for the first time or if has been updated, and so make _post_save behave differently in the two situations? TIA, paolo

Re: Duplicate objects

2005-09-22 Thread paolo
[EMAIL PROTECTED] ha scritto: > Hi > > I'm bing a bit slow I think. All i want to do is get an object and > create a new entry that is a duplicate of it. > The parameter save_as should do what your need. Model reference document offers more details.

Re: error: (10053, 'Software caused connection abort')

2005-09-10 Thread paolo
Eugene Lazutkin wrote: [cut[ > error: (10053, 'Software caused connection abort') "This error can occur when the local network system aborts a connection, such as when Winsock closes an established connection after data retransmission fails (receiver never acknowledges data sent on a datastream s

Need help in structuring db for my app

2005-09-07 Thread paolo
want that the price inside the configuration is changed. I'd really really appreciate at least some comments :-) (but please, possibly not about my mental disorders!) Thanks for reading, paolo

Different fieldsets for the same fields in admin?

2005-08-26 Thread paolo
class Ingredient(meta.Model): name = meta.CharField('Name', maxlength=128) short_desc = meta.TextField('Short desc') long_desc = meta.TextField('Long desc') category = meta.ForeignKey(Ing_category, core=True) class META: admin = meta.Admin() class Intermediary(meta.Model): ing = meta.ForeignKey(Ingredient) quantity = meta.IntegerField("Quantity") recipe = meta.ForeignKey(Recipe, edit_inline=True, num_in_admin=5) class META: verbose_name = "Ingredient list" Thanks for your patience... paolo

Re: Show auxiliary data in admin interface for a model

2005-08-26 Thread paolo
I realized that it was enough to have a string containing both the component name and the price. In this way in the admin page for adding a new configuration (that shows the components list too, due to edit_inline=True) will be shown a combobox with, as said, the string 'comp name -- price' obtain

Show auxiliary data in admin interface for a model

2005-08-26 Thread paolo
t's listbox, its price appears somewhere. I'd like to avoid the javascript solution, as probably it wouldn't be trivial and I don't know javascript well.. So I thought to change __repr__ to return a tuple containing self.code and self.price, but some problems arise. Can you suggest some alternatives? Thanks, paolo

Re: Help me checking this model.. (tb included)

2005-08-22 Thread paolo
pe' is not defined So the model now defines classes in this order: Ingredient, Recipes, Intermediary and all works fine. My question is.. if order matters, is there the possibility, expecially in complex models, to reach a "deadlock" condition? Thanks, paolo

Help me checking this model.. (tb included)

2005-08-20 Thread paolo
f.choices) and len(manipulator[f.name].choices) == 2: File "/usr/local/lib/python2.3/site-packages/django/core/formfields.py", line 26, in __getitem__ raise KeyError, "Field %s not found" % field_name KeyError: 'Field intermediary_id not found' What's wrong with my implementation? Thanks, paolo

Re: Set arguments in model dinamically

2005-08-18 Thread paolo
Adrian Holovaty ha scritto: > On 8/17/05, paolo <[EMAIL PROTECTED]> wrote: [cut] > > For customization like this, you can write some custom JavaScript that > alters your form in that way. Then just add the path to your > JavaScript file to the "admin.js" list

Set arguments in model dinamically

2005-08-17 Thread paolo
The model I'm using for 'customers' has a BooleanField called 'blocked'. I'd like that when blocked is True other fields won't be shown, or eventually won't be editable. How to obtain this? Thanks

Split model's classes in more modules

2005-08-17 Thread paolo
I thought it was a valid option to fragment models' classes in more python modules, and import them inside project/apps/application/models/application.py However when i try django-admin.py sql application I get a traceback (http://django.pastebin.com/339033) Do you know what I'm doing wrong? Tha