Re: Authentication in API (REST)

2011-06-15 Thread Stuart MacKay
Malcolm, oAuth also looks like a great solution - it was not as well developed when I last looked at REST authentication a couple of years ago. There is a lot of developer support now as well, http://oauth.net/code/, specifically https://github.com/simplegeo/python-oauth2 Stuart I think oa

Re: Moving Away from if/else Template Logic

2011-06-15 Thread bruno desthuilliers
On Jun 15, 5:04 am, Greg Corradini wrote: > Hello All, > > I'm try to get away from doing if/else in a template: > > {% if x.message|regtest == "True" %} >     do something cool > {% else %} >     do something less cool > {% endif %} > (snip) > I would like to move to something like this in the t

Re: Unsafe to continue Django session unencrypted? (i.e. login with HTTPS then drop to HTTP after that?)

2011-06-15 Thread Tom Evans
On Wed, Jun 15, 2011 at 5:40 AM, Chris Seberino wrote: > > On Jun 14, 10:47 am, Tom Evans wrote: >> Yes, of course it is - HTTP is stateless, so how else would sessions >> work if the session id is not transmitted back to the server by the >> browser? > > I agree.  Yet, eBay, Google Groups & Goda

Using django floppy forms , how do I get the longitude and latitude of the point I clicked , or the line I draw ?

2011-06-15 Thread Satyajit Sarangi
I want to know how to get the latitude and logitiude of a point , or a line that I marked on open layers using django floppy forms . It returns the geom_id , but how do I get latitude and longitude out of it ? -- You received this message because you are subscribed to the Google Groups "Django u

Printing admin is strange except in Safari

2011-06-15 Thread Ivo Brodien
Hello, I have an admin action which produces a table of selected items. I used the admin base_site template so I have the ability to go back easily. I did: {% extends "admin/base_site.html" %} ... {% block content %} {% for participant in participants %} ... {

Odp: Aw: Internationalization in Django.

2011-06-15 Thread Robert
What about django-datatrans ? Had no problems with that. RM. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/-wSxOnaLg2gJ. To post to this group, send ema

Djungo on Microsoft IIS

2011-06-15 Thread Yaroslav Govorunov
Hello! We have recently developed a solution to install and run Django applications on Microsoft IIS. Here is the link: http://www.helicontech.com/zoo/ Currently IIS 7, 7.5 and IIS Express are supported. We expect to demonstrate production level performance in this environment on release. To u

unique constraint

2011-06-15 Thread Tobias Ottenweller
hi, a had a look at the django documentation but I could not find a way to do something like this in django: CREATE TABLE test_table ( id integer, name text ); ALTER TABLE ONLY test_table ADD CONSTRAINT test_table_id_name_key UNIQUE (id, name); Is there a way to put a constrain

Re: unique constraint

2011-06-15 Thread Ivo Brodien
https://docs.djangoproject.com/en/1.3/ref/models/options/#unique-together On Jun 15, 2011, at 9:40 AM, Tobias Ottenweller wrote: > hi, > > a had a look at the django documentation but I could not find a way to do > something like this in django: > > > CREATE TABLE test_table ( >id integer

My django admin page breaks up . Any reason why ?

2011-06-15 Thread Satyajit Sarangi
My django admin page some times breaks up . As in , initially it will show all the required tables in a nice columns , but suddenly the whole design breaks and the data shows up in random ways . Also how to reset the django admin password ? -- You received this message because you are subscribed

Re: My django admin page breaks up . Any reason why ?

2011-06-15 Thread Anoop Thomas Mathew
Hi Satyajit, On 15 June 2011 16:19, Satyajit Sarangi wrote: > My django admin page some times breaks up . As in , initially it will > show all the required tables in a nice columns , but suddenly the > whole design breaks and the data shows up in random ways . > 1. The page breaks up because a

How to display shp file data on an osm layer using django without using the databrowse widget ?

2011-06-15 Thread Satyajit Sarangi
I want to display the data that I have stored ,( Openlayers data , kml , shp file) data from postgis data on a openlayers/google map template . How do I do it ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Multiple forms into one form/trouble accessing form fields

2011-06-15 Thread Thomas Weholt
I got several forms I need to display in one page and post to one site. Actually, what I want to do is take all the fields from all the forms and display them as one form and post all input to one view. To avoid collision between the form fields I want to prefix the fields somehow. Say I got three

Re: Multiple forms into one form/trouble accessing form fields

2011-06-15 Thread Alasdair Nicol
https://docs.djangoproject.com/en/dev/ref/forms/api/#prefixes-for-forms Regards, Alasdair On 15/06/11 14:09, Thomas Weholt wrote: I got several forms I need to display in one page and post to one site. Actually, what I want to do is take all the fields from all the forms and display them as one

Helper methods like rails or taglibs/tagfiles like java

2011-06-15 Thread Rodrigo Gomes
Hi, I was looking for some 'html helpers' in django as we have on rails or java (with tagfiles or taglibs), but I saw that it doesn't exist, according to this stackoverflow response: http://stackoverflow.com/questions/61451/does-django-have-html-helpers The guy suggested to write custom template

Re: Helper methods like rails or taglibs/tagfiles like java

2011-06-15 Thread Tom Evans
On Wed, Jun 15, 2011 at 3:01 PM, Rodrigo Gomes wrote: > Hi, > I was looking for some 'html helpers' in django as we have on rails or java > (with tagfiles or taglibs), but I saw that it doesn't exist, according to > this stackoverflow response: > http://stackoverflow.com/questions/61451/does-djang

Re: Djungo on Microsoft IIS

2011-06-15 Thread CrabbyPete
Yaroslav, I tried and tried to get Django to work with IIS on my Windows Server, but could not get it to work. I would love to know how you did it. I finally gave up and installed Apache on Windows. Will this work with an existing Django project? Pete On Jun 15, 2:52 am, Yaroslav Govorunov wrot

Re: Django admin report

2011-06-15 Thread Derek
On Jun 14, 6:28 pm, Andre Terra wrote: > If all you need translating is README.rst, here goes: > > Django Admin Report > > Django Admin Report is a small django application that allows for easy > exporting of PDF reports through the admin interface. > > Dependencies > > -Pisa (http://www.xhtml2pdf

Re: Moving Away from if/else Template Logic

2011-06-15 Thread francescortiz
you could try something like {% with x.message|regtest as value %} {% include "messages/"|add:value|add:".html" %} {% endwith %} On 15 Juny, 05:04, Greg Corradini wrote: > Hello All, > > I'm try to get away from doing if/else in a template: > > {% if x.message|regtest == "True" %} >     do some

Re: Django admin report

2011-06-15 Thread Leonardo da Costa Santos
Thanks very much! Atenciosamente, Leonardo da Costa Santos Desenvolvedor na e-Tick Graduando em Sistemas de Informação - FIP 2011/6/15 Derek > On Jun 14, 6:28 pm, Andre Terra wrote: > > If all you need translating is README.rst, here goes: > > > > Django Admin Report > > > > Django Admin Rep

Re: Integrity Error with generic relation using ContentType

2011-06-15 Thread christian.posta
Well, there are some ways around it if you use dumpdata/loaddata statements. But for initial fixtures, it causes trouble. When the DB is created, django will dynamically try to populate the content-types table. But if you are already putting data into that table, the primary keys will clash. When

Re: storing django object into javascript variable/array

2011-06-15 Thread Ian Clelland
On Wed, Jun 15, 2011 at 7:27 AM, jay K. wrote: > Hello, > > I've posted my question before, but I believe I didn't provide enough > detail. I intend to present my issue again, this time with more > detail. > > Let me tell you that I am not a django developer, so I have very > limited exposure to

Re: storing django object into javascript variable/array

2011-06-15 Thread Tom Evans
On Wed, Jun 15, 2011 at 3:27 PM, jay K. wrote: > Hello, > > I've posted my question before, but I believe I didn't provide enough > detail. I intend to present my issue again, this time with more > detail. > >... > > Now, I manage to see the output of the javascript written above > through Firefox

Re: Djungo on Microsoft IIS

2011-06-15 Thread Yaroslav Govorunov
Pete, We have developed our own FastCGI module and Django (WSGI) wrapper, that is why it should work now. Yes, it is intended to work with existing project, but note it is beta and we are asking to help us to beta-test it. I cannot suggest to install it in production environment until beta testin

Re: storing django object into javascript variable/array

2011-06-15 Thread jay K.
Hello, I apologize for seeming too impatient or rude, actually I'm a bit in a hurry because I was given a project and was told that it was urgent. I miscalculated how much time it was going to take me to learn django Anyway, what I want to do is to use the variables variables city_schools, city_l

Re: storing django object into javascript variable/array

2011-06-15 Thread Tim Sawyer
This might help: http://drumcoder.co.uk/blog/2009/nov/26/google-maps-django/ Tim. > Hello, > > I apologize for seeming too impatient or rude, actually I'm a bit in a > hurry > because I was given a project > and was told that it was urgent. I miscalculated how much time it was > going > to take

Re: storing django object into javascript variable/array

2011-06-15 Thread Tom Evans
On Wed, Jun 15, 2011 at 4:59 PM, jay K. wrote: > Hello, > > I apologize for seeming too impatient or rude, actually I'm a bit in a hurry > because I was given a project > and was told that it was urgent. I miscalculated how much time it was going > to take me to learn django > > Anyway, what I wan

Need help with tutorial

2011-06-15 Thread Kyle Latham
I'm trying to work my way through the tutorial 1 but am getting stuck. I am using python 2.7 and am using SQLite3 like the tutorial recommended for beginners I am at the step where I am changing the models.py file to add the _unicode_ methods to display the Poll Object I believe I have the NAME i

Re: Need help with tutorial

2011-06-15 Thread Cal Leeming [Simplicity Media Ltd]
Please please please please PLEASE, always post the code you are having trouble with. I've lost track on the amount of times people have to be told this :/ It's like saying "I made a change to this file, but it didn't work, why not?" Come on man. On Wed, Jun 15, 2011 at 5:48 PM, Kyle Latham wrote

Re: Need help with tutorial

2011-06-15 Thread Kyle Latham
I understand your frustration. I'm sorry for not posting my code with my first post. my settings.py file (only up to the part I changed) is below: # Django settings for mysite project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Name', 'n...@email.com'), ) MANAGERS = ADMINS DATABAS

Re: Need help with tutorial

2011-06-15 Thread Cal Leeming [Simplicity Media Ltd]
No problem. You need to use __unicode__, not _unicode_ :) Cal On Wed, Jun 15, 2011 at 6:02 PM, Kyle Latham wrote: > I understand your frustration. I'm sorry for not posting my code with > my first post. > > my settings.py file (only up to the part I changed) is below: > > # Django settings for

Re: Need help with tutorial

2011-06-15 Thread Tim Shaffer
There should be two underscores before and after the "unicode" in the method name: "__unicode__" instead of "_unicode_" -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/d

Re: Need help with tutorial

2011-06-15 Thread Kyle Latham
Wow. I feel like a dumbass haha. That worked! Thank you so much for your help! On Jun 15, 11:15 am, "Cal Leeming [Simplicity Media Ltd]" wrote: > No problem. > > You need to use __unicode__, not _unicode_ :) > > Cal > > > > > > > > On Wed, Jun 15, 2011 at 6:02 PM, Kyle Latham wrote: > > I unders

Re: Helper methods like rails or taglibs/tagfiles like java

2011-06-15 Thread Rodrigo Gomes
Hi Tom, thanks for your reply. Inclusion tag seems to be better (to write) than the other kinds of tags. But I think that it is still too many things to do just to write a tag. But it works, and I'm doing this way right now :) Thanks, Rodrigo Gomes On Wed, Jun 15, 2011 at 11:11 AM, Tom Evans w

Re: storing django object into javascript variable/array

2011-06-15 Thread John Finlay
On 6/15/11 8:59 AM, jay K. wrote: Hello, I apologize for seeming too impatient or rude, actually I'm a bit in a hurry because I was given a project and was told that it was urgent. I miscalculated how much time it was going to take me to learn django Anyway, what I want to do is to use the v

Re: sorl thumbnail

2011-06-15 Thread Greg Donald
So what does one use for thumbnails when sorl thumbnail works great in development but fails on two different production servers? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.

Re: storing django object into javascript variable/array

2011-06-15 Thread jay K.
Actually i had my code like this for(var i = 0; i < city_schools.length; i++){ . } But somehow i missed the .length when I posted my message... sorry if it caused any confusions I think the problem is that the data is not being stored in the array properly, or at least I'm not doing it right

Re: Helper methods like rails or taglibs/tagfiles like java

2011-06-15 Thread Tim Shaffer
Another option, if your use-case doesn't require anything terribly complex, is to just include another template and pass your variables to it: {% include "link_to.html" with url="google.com" text="check out google" %} In link_to.html: {{ text }} https://docs.djangoproject.com/en/1.3/ref/templa

How to make geodjango databrowse admin view GeometryCollection Field data ?

2011-06-15 Thread Satyajit Sarangi
The present databrowse doesnt load if the model has anything apart from point . How to make it load for polygon , line string and GeometryCollectionField ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

Re: Helper methods like rails or taglibs/tagfiles like java

2011-06-15 Thread bruno desthuilliers
On 15 juin, 20:48, Tim Shaffer wrote: > Another option, if your use-case doesn't require anything terribly complex, > is to just include another template and pass your variables to it: > > {% include "link_to.html" with url="google.com" text="check out google" %} > > In link_to.html: > > {{ text }

Strip_tags and non english char issue

2011-06-15 Thread ydjango
I have rich text (in utf8) which I want to show in standard browser tooltip. I strip html tags using strip_tags as they show as html tags in tooltip. Issue is that it seems strip_tags is stripping or converting certain turkish characters like ü into weird special chars? I am unable to use dja

django.db.utils.IntegrityError: null value in column “layer_id_id” violates not-null constraint . How to debug ?

2011-06-15 Thread Satyajit Sarangi
his is my models.py from django.db import models class Sdr_Layer(models.Model): layer_name = models.CharField(max_length = 100) layer_attribute_name=models.CharField(max_length=100) # This is an auto-generated Django model module created by ogrinspect. from django.contrib.gis.db import models

How do I link one template with another template ?

2011-06-15 Thread Satyajit Sarangi
I have a template , in which I want to display a link , which when clicked takes the user to another template of another app . How to do it ? I understand its a basic django question , but still any help would be usefull . -- You received this message because you are subscribed to the Google Gro

Re: How do I link one template with another template ?

2011-06-15 Thread Shawn Milochik
Use a named URL, then the {% url %} template tag. https://docs.djangoproject.com/en/1.3/topics/http/urls/#naming-url-patterns See the example and explanation in the docs. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: How do I link one template with another template ?

2011-06-15 Thread Satyajit Sarangi
Can you show it in an html tag ? As in in a template , on click of the url Thanks for the help On Thu, Jun 16, 2011 at 3:14 AM, Shawn Milochik wrote: > Use a named URL, then the {% url %} template tag. > > https://docs.djangoproject.com/en/1.3/topics/http/urls/#naming-url-patterns > > See the e

Re: How do I link one template with another template ?

2011-06-15 Thread Shawn Milochik
On 06/15/2011 05:48 PM, Satyajit Sarangi wrote: Can you show it in an html tag ? As in in a template , on click of the url Thanks for the help Sure. Example from docs: {% url arch-summary 1945 %} In an HTML tag: Summary for 1945 -- You received this message because you are subscribed

GeoDjango issue with pysqlite

2011-06-15 Thread Ed
Hi, I have followed the installation guide to the letter but am still having issues when trying to syncdb. I get the following error "The pysqlite library does not support C extension". I have installed pysqlite with the following setup.cfg [build_ext] #define= include_dirs=/Library/Frameworks

Re: How do I link one template with another template ?

2011-06-15 Thread Satyajit Sarangi
Ok . I am getting this error Exception Type:GEOSIndexError I will show you the code . This is my maps.html {{ form.media }} {% csrf_token %} {{ form.as_p }} {% block content %} {% for entry in data %} {{ data }} {% endfor %} {% endblock %} T

Re: Helper methods like rails or taglibs/tagfiles like java

2011-06-15 Thread Tim Shaffer
The link was just an example. It could be a more complex block of HTML. Point being if the tag just massaging data into HTML, you can accomplish it with another template without creating a tag. -- You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: Helper methods like rails or taglibs/tagfiles like java

2011-06-15 Thread Kenneth Gonsalves
On Wed, 2011-06-15 at 11:01 -0300, Rodrigo Gomes wrote: > But I think that I'm missing something. Is it so hard to write a > simple > custom select box, for example? I need to write a parser, a render and > put > in the html in another file? Or there is a easer way to do that? > > as mentioned,

Re: sorl thumbnail

2011-06-15 Thread Kenneth Gonsalves
On Wed, 2011-06-15 at 10:39 -0700, Greg Donald wrote: > So what does one use for thumbnails when sorl thumbnail works great > in > development but fails on two different production servers? > > easy-thumbnail -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstu

filter chaining question

2011-06-15 Thread Bobby Roberts
consider this: findit = inventory.objects.filter(Barcode = self.Barcode, Condition__name = "good") How could i make this filter say "good" or "acceptable" or IN ('good','acceptable') -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: filter chaining question

2011-06-15 Thread Jani Tiainen
On Wed, 2011-06-15 at 20:28 -0700, Bobby Roberts wrote: > consider this: > > findit = inventory.objects.filter(Barcode = self.Barcode, > Condition__name = "good") > > How could i make this filter say "good" or "acceptable" .filter(Q(Condition__name='good') | Q(Condition__name='acceptable')) >