Re: setlang using AJAX
Hi Radovan, this code should go on a web page before the real application. Basically I'd like to have the user click on a flag representing the language and load the real site with the appropriate language. Thanks L. On 30 Mag, 15:30, urukay wrote: > hi, > > but you have to reload the whole page anyway or you want only part of > the page to be translated? > There's a way to change language without form. > > R. > > On 30. Máj, 13:07 h., Luca Casagrande > wrote: > > > > > > > > > Hello everybody, > > I'd like to use an AJAX request without any form to change the > > language of my site. > > My problem is that I haven't found a way to avoid the csrf_token > > error.. > > How can I generate the token without any form? > > > The other way it to use setlang with a GET request but, according to > > docs, this seems no more possible. > > > Thanks for your support. > > Luca -- 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.
setlang using AJAX
Hello everybody, I'd like to use an AJAX request without any form to change the language of my site. My problem is that I haven't found a way to avoid the csrf_token error.. How can I generate the token without any form? The other way it to use setlang with a GET request but, according to docs, this seems no more possible. Thanks for your support. Luca -- 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: Localization of CharField entries
On 22 Mar, 10:22, bruno desthuilliers wrote: > on 22 mar, 09:26, Luca Casagrande wrote: > > > Hello everyone, > > I'm working on the localization of a Django project and I met some > > difficulties. Following the documentation in the section > > "Internationalization ", I could easily translate the contents of the > > templates and the verbose_name of the model's attributes. > > The problem is that one of my models has a notes field (CharField) > > with different text for each entry. > > What is the best way to translate those values, if possible, always > > working with po files? > > gettext / po files are for the "static" text only (that is, text in > your source code). Translations of your application data has to be > handled at the, well, application data level (IOW: in your db). There > are quite a few "multilingual model" solutions around, I've been > mostly happy with transmet so far but didn't have to handle more than > 3 languages at once - not sure how it would scale for a dozen or more. > > http://code.google.com/p/django-transmeta/ Thanks for your answer. Right now the db is full populated, and I have seen that transmeta need to create new columns. Should do thi by hand or there's another approach to this operation (i.e. South) ? Luca -- 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.
Localization of CharField entries
Hello everyone, I'm working on the localization of a Django project and I met some difficulties. Following the documentation in the section "Internationalization ", I could easily translate the contents of the templates and the verbose_name of the model's attributes. The problem is that one of my models has a notes field (CharField) with different text for each entry. What is the best way to translate those values, if possible, always working with po files? Thank you very much Luca -- 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.
GeoDjango admin and data reprojection
Hello everybody, I have simple model defined like this: class point(models.Model): geom = models.PointField(srid='3004') object = models.GeoManager() In PostGIS spatial_ref_sys table and in proj's epsg file I changed the proj string adding the +towgs84 parameters to have a better reprojection. In the admin page the point is correctly shown on the map but it's shifted of about 50m like if the +towgs84 parameters were missing. I double checked this using a Desktop GIS reprojecting the data from EPSG:3004 to EPSG:900913 without +towgs84 and the position is the same. I don't understand how Django request a feature to be drawn and which tools uses for reprojection. Thx for your help Luca -- 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.
Removing title from each admin page
Hello folks, is there any way to remove the title over each admin element, like "Site administration" or "Select..to change". Thanks Luca -- 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.
Filter data inside template
Hello everybody, is it possible to filter data inside template? I have 2 models with a foreignkey relationship: class Requests(models.Model): name = models.CharField(max_length=16) surname = models.CharField(max_length=16) class Information(models.Model): request = models.ForeignKey(Requests) description = models.CharField(max_length=16) >From the view to the template I pass a dictionary of requests and one of information. What I need to do is something like this: {% for r in requests %} {% for i in informations WHERE request=r %} {{i.description}} {% endfor %} {% endfor %} Any idea? Thx -- 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.
Looping through models
Hello everybody, using GeoDjango I need to do a spatial intersections through a lot of different model (polygon): output1 = model1.objects.filter(geom__intersects=fs[0].geom) output2 = model2.objects.filter(geom__intersects=fs[0].geom) ... Where fs is a QuerySet output. Is there a way to create a loop changing only the model name? Thank you very much Luca -- 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.