Announcement: django-geoshortcuts - GeoJSON and GPX shortcuts for GeoDjango apps
Hi, we have created small Django application package for serving some GIS geospatial formats from Django queryset data. Currently supported formats are GeoJSON and GPS via 'render_to_geojson' and 'render_to_gpx shortcuts'. If You are interested, please have a look here [1]. Comments, patches and whatever else is welcome. [1] - https://github.com/gista/django-geoshortcuts Ivan Mincik, Gista s.r.o. -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Custom Django Admin translations
Hi, I would like to ask, what is the best way to change some of the translation messages in Django Admin to custom ones. Is there any good way, how to override system translations of Admin in some projects where I need it ? Thanks Ivan -- 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 more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Bad DateTime for LANGUAGE_CODE = 'sk'
On Tue, Aug 11, 2009 at 10:09 AM, gentlestonewrote: > > My settings: > > DEFAULT_CHARSET = "utf-8" > TIME_ZONE = 'Europe/Bratislava' > LANGUAGE_CODE = 'sk' > USE_I18N = True > > DateTime fields are displayed in the admin page incorrectly. If I > change the language code for 'en' or 'cz', the display format is ok. > It is propably a bug. How can I fix it? Yes, I can confirm this behavior. > > > --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: reportlab - filename of generated PDF
On Monday 26 January 2009, Vinay Sajip wrote: > > On Jan 26, 7:59 am, Ivan Mincik <ivan.min...@gmail.com> wrote: > > Dear django users, > > we have a problem with filename of resulting PDF generated by reportlab and > > then downloaded by browser. > > > > Generated PDF is OK, but filename is incorrect. It is allways something > > like "randomstring.pdf.part". (for example sa34sdfasdf.pdf.part) > > > > in the "view.py" there are these lines: > > response = HttpResponse(mimetype='application/pdf') > > response['Content-Disposition'] = 'filename=gisplan.pdf' > > > > Please, can anybody see where can be the problem ? > > It looks like a temporary filename generated by whatever is > downloading the file. For example, Firefox, while downloading, would > name the file "gisplan.pdf.part" and rename it to "gisplan.pdf" after > the download completed. If the downloader completed the download > (accounting for the OK PDF file) but failed to rename it, you might > get the result which you observed. > > I use a slightly different content-disposition, indicating explicitly > that it's an attachment: > > response['Content-Disposition'] = 'attachment; filename=gisplan.pdf' > > With this approach, everything works as expected for me. Thanks, it is working now. > > Regards, > > Vinay Sajip > > > --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
reportlab - filename of generated PDF
Dear django users, we have a problem with filename of resulting PDF generated by reportlab and then downloaded by browser. Generated PDF is OK, but filename is incorrect. It is allways something like "randomstring.pdf.part". (for example sa34sdfasdf.pdf.part) in the "view.py" there are these lines: response = HttpResponse(mimetype='application/pdf') response['Content-Disposition'] = 'filename=gisplan.pdf' Please, can anybody see where can be the problem ? Ivan --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Best IDE for Django and python?
Komodo Edit 5 couldn't run at Debian Etch. Has anybody some older version ? (4) Ivan On Wednesday 26 November 2008 17:50, vivek wrote: > > I also use komodo ide : > - It can be used with other dynamic languages like php, so if you > sometimes need to do something in languages other than python, it can > come in handy. > - They have excellent licensing policy > > but i doubt there is any "best" ide to everyone's need. Most of > choices suggested here are either free or free to try, so you can try > them first. > > > How do you develop your django projects, and where do you go when you > > need to find documentation? > > now for your second question: > > http://docs.djangoproject.com/ > http://www.djangobook.com/ > > both are excellent resources for django documentation. > > > -- Mgr. Ivan Minčík Gista s.r.o tel:. 0907 639 570 email: [EMAIL PROTECTED] http://www.gista.sk, http://demo.gisplan.sk --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Bug in Admin or in my model ?
On Saturday 15 November 2008 18:57, Karen Tracey wrote: > There's a bug both in your models and in Django, I think. Your __unicode__ > method for class Metadata: > >def __unicode__(self): > >return "%s %s" % (self.vrstva,self.nazov) > > > > needs to be: > >def __unicode__(self): > > >return u"%s %s" % (self.vrstva,self.nazov) Karen, really thanks a lot for perfect guess. Problem solved. > > > The bug in Django is that the attempt to report that your existing > __unicode__ method generated an error generated yet another error, and I > haven't quite figured that one out yet. But if you want to make progress > you can just fix your __unicode__ method. What to do with this? Do I have to fill some bug report ? > > Karen > > > > Ivan --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Bug in Admin or in my model ?
On Saturday 15 November 2008 17:34, Luke Seelenbinder wrote: > > You need to specify your encoding in your models file. > Like: # -*- coding: iso-8859-15 -*- > Look at http:// > evanjones.ca/python-utf8.html The sixth section of the page > explains. thanks for answer, but the first line in my models.py is # -*- coding: utf-8 -*-. Please see : http://gista.sk/dl/bugs/django/models.py > > Regards > Luke > > On Nov 15, 11:09 am, Ivan Mincik <[EMAIL PROTECTED]> wrote: > > Hi, > > I have a problem when adding record by Django Admin and I am not sure where > > I have to look for it. Is this some problem in Django Admin or it can be > > solved by some > > configuration in model ? > > I use Foreign Key in table where I want to add record. Foreign Key is the > > field containing some non ASCII characters. > > See:http://gista.sk/dl/bugs/django/add_record_in_admin.png > > I want to add record to "Metadata" which uses ForeignKey from "Vrstva". > > > > *** When I submit, I get this error (nothing else printed): > > Screenshot is > > here:http://gista.sk/dl/bugs/django/add_record_in_admin_submit.png > > > > Mod_python error: "PythonHandler django.core.handlers.modpython" > > > > Traceback (most recent call last): > > > > File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 299, > > in HandlerDispatch > > result = object(req) > > > > File > > "/var/lib/python-support/python2.4/django/core/handlers/modpython.py", line > > 222, in handler > > return ModPythonHandler()(req) > > > > File > > "/var/lib/python-support/python2.4/django/core/handlers/modpython.py", line > > 195, in __call__ > > response = self.get_response(request) > > > > File "/var/lib/python-support/python2.4/django/core/handlers/base.py", > > line 128, in get_response > > return self.handle_uncaught_exception(request, resolver, exc_info) > > > > File "/var/lib/python-support/python2.4/django/core/handlers/base.py", > > line 148, in handle_uncaught_exception > > return debug.technical_500_response(request, *exc_info) > > > > File "/var/lib/python-support/python2.4/django/views/debug.py", line 39, > > in technical_500_response > > html = reporter.get_traceback_html() > > > > File "/var/lib/python-support/python2.4/django/views/debug.py", line 95, > > in get_traceback_html > > c = Context({ > > > > File "/var/lib/python-support/python2.4/django/utils/encoding.py", line > > 35, in smart_unicode > > return force_unicode(s, encoding, strings_only, errors) > > > > File "/var/lib/python-support/python2.4/django/utils/encoding.py", line > > 70, in force_unicode > > raise DjangoUnicodeDecodeError(s, *e.args) > > > > DjangoUnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position > > 1: ordinal not in range(128). You passed in > > > > *** Snippets from my model: > > Full models.py is here:http://gista.sk/dl/bugs/django/models.py > > > > class Metadata(models.Model): > > vrstva = models.ForeignKey(Vrstva) > > nazov = models.CharField(u"Názov stĺpca", max_length=100) > > dlhy_nazov = models.CharField(u"Dlhý názov stĺpca", max_length=200) > > hodnota = models.CharField(u"Formátovanie hodnoty", max_length=512, > > default="%s") > > externa_databaza = models.ForeignKey(Externa_databaza, blank=True, > > null=True) > > sql = models.TextField(u"SQL dopyt", blank=True) > > > > def __unicode__(self): > > return "%s %s" % (self.vrstva,self.nazov) > > > > class Meta: > > ordering = ["vrstva", "nazov"] > > verbose_name_plural = u"metadata" > > > > class Vrstva(Vrstvy_zaklad): > > kategoria = models.ForeignKey(Kategoria, verbose_name=u"Kategória") > > sql_atrib = models.TextField(u"Atributový SQL", blank=True) > > tabulka = models.CharField(u"Tabuľka", max_length=200, blank=True, > > help_text=u"Tabuľka v ktorej sú gid a geom pre danú vrstvu") > > transparent = models.BooleanField(u"Transparent") > > zoom_level = models.IntegerField(u"Zoom level", default=1, > > help_text=u"Zoom level ktory sa použije
Bug in Admin or in my model ?
Hi, I have a problem when adding record by Django Admin and I am not sure where I have to look for it. Is this some problem in Django Admin or it can be solved by some configuration in model ? I use Foreign Key in table where I want to add record. Foreign Key is the field containing some non ASCII characters. See: http://gista.sk/dl/bugs/django/add_record_in_admin.png I want to add record to "Metadata" which uses ForeignKey from "Vrstva". *** When I submit, I get this error (nothing else printed): Screenshot is here: http://gista.sk/dl/bugs/django/add_record_in_admin_submit.png Mod_python error: "PythonHandler django.core.handlers.modpython" Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch result = object(req) File "/var/lib/python-support/python2.4/django/core/handlers/modpython.py", line 222, in handler return ModPythonHandler()(req) File "/var/lib/python-support/python2.4/django/core/handlers/modpython.py", line 195, in __call__ response = self.get_response(request) File "/var/lib/python-support/python2.4/django/core/handlers/base.py", line 128, in get_response return self.handle_uncaught_exception(request, resolver, exc_info) File "/var/lib/python-support/python2.4/django/core/handlers/base.py", line 148, in handle_uncaught_exception return debug.technical_500_response(request, *exc_info) File "/var/lib/python-support/python2.4/django/views/debug.py", line 39, in technical_500_response html = reporter.get_traceback_html() File "/var/lib/python-support/python2.4/django/views/debug.py", line 95, in get_traceback_html c = Context({ File "/var/lib/python-support/python2.4/django/utils/encoding.py", line 35, in smart_unicode return force_unicode(s, encoding, strings_only, errors) File "/var/lib/python-support/python2.4/django/utils/encoding.py", line 70, in force_unicode raise DjangoUnicodeDecodeError(s, *e.args) DjangoUnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128). You passed in *** Snippets from my model: Full models.py is here: http://gista.sk/dl/bugs/django/models.py class Metadata(models.Model): vrstva = models.ForeignKey(Vrstva) nazov = models.CharField(u"Názov stĺpca", max_length=100) dlhy_nazov = models.CharField(u"Dlhý názov stĺpca", max_length=200) hodnota = models.CharField(u"Formátovanie hodnoty", max_length=512, default="%s") externa_databaza = models.ForeignKey(Externa_databaza, blank=True, null=True) sql = models.TextField(u"SQL dopyt", blank=True) def __unicode__(self): return "%s %s" % (self.vrstva,self.nazov) class Meta: ordering = ["vrstva", "nazov"] verbose_name_plural = u"metadata" class Vrstva(Vrstvy_zaklad): kategoria = models.ForeignKey(Kategoria, verbose_name=u"Kategória") sql_atrib = models.TextField(u"Atributový SQL", blank=True) tabulka = models.CharField(u"Tabuľka", max_length=200, blank=True, help_text=u"Tabuľka v ktorej sú gid a geom pre danú vrstvu") transparent = models.BooleanField(u"Transparent") zoom_level = models.IntegerField(u"Zoom level", default=1, help_text=u"Zoom level ktory sa použije pri zoomovaní na objekt pri vyhľadávaní") sql_hladanie = models.TextField(u"Vyhľadávací SQL", blank=True) class Meta: ordering = ['kategoria','poradie'] verbose_name_plural = u"vrstvy" *** My environment details: OS: Debian Etch with python 2.4 Django version: 1.0, also tested on new 1.0.1 with same results Database: PostgreSQL 8.1 *** It looks like the bug #3924 which should be allready closed. Can anybody give me some hint where to look for the solution ? Thanks a lot -- Ivan --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---