Error in gcmodule.c

2011-05-02 Thread maor
Has anyone seen this Python crash before?  It outputs the following line 
when it crashes:

python: Modules/gcmodule.c:277: visit_decref: Assertion `gc->gc.gc_refs != 
0' failed.

I'm running Django on RHEL6, and I keep getting this crash few minutes after 
the webapp starts serving pages.  It started happening when I upgraded to 
RHEL6 (Python 2.6.5)
The issue goes away when I use a Python 2.6.5 Installation that I built 
myself. 
I prefer to avoid this work around because I rely on Red Hat to make a 
better optimized and stabilized build of python.

So did anyone have experience with such an error?

Thanks,
-Maor

-- 
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: How do I set permissions for manual install of 1.3 for ubuntu 11.04?

2011-05-02 Thread Xavier Ordoquy
Hi,

Le 30 avr. 2011 à 12:16, jsierra a écrit :

> I figured it out, i chmod -R 775 the django directory located in 
> /usr/local/lib/python2.7/dist-packages and was able to use the commands 
> without sudo. Whether or not that's a good idea, I don't know, but it's my 
> personal laptop anyway. Thanks for tying to help Shawn. Much appreciated.

Might be a bit late but instead of doing so, please consider using virtualenv.
You'll get an "extended" python space in your local directories with your own 
user (no need to sudo to install package).
virtualenv and pip are win with almost no effort.

Regards,
Xavier.

-- 
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.



Advanced Search

2011-05-02 Thread pankaj sharma
i am new on django, i want to know how can we make advanced search on
our website.


i have database of colleges. and i want to provide the user to search
the colleges by :
city and name

i have made single search where user can enter the query and it will
show only those colleges having the query in their names
i also want to do it for city,

please help me

-- 
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: Advanced Search

2011-05-02 Thread Daniel França
Hi,
you can try: http://haystacksearch.org/
I think it solves your problem

Best Regards,
Daniel França

On Mon, May 2, 2011 at 5:11 AM, pankaj sharma wrote:

> i am new on django, i want to know how can we make advanced search on
> our website.
>
>
> i have database of colleges. and i want to provide the user to search
> the colleges by :
> city and name
>
> i have made single search where user can enter the query and it will
> show only those colleges having the query in their names
> i also want to do it for city,
>
> please help me
>
> --
> 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.
>
>

-- 
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: Advanced Search

2011-05-02 Thread Ankit Rai
Hi,

Are city and name are the fields of your models?If yes than you can write
your custom search using queryset , refer search implementation in django
admin



On Mon, May 2, 2011 at 1:41 PM, pankaj sharma wrote:

> i am new on django, i want to know how can we make advanced search on
> our website.
>
>
> i have database of colleges. and i want to provide the user to search
> the colleges by :
> city and name
>
> i have made single search where user can enter the query and it will
> show only those colleges having the query in their names
> i also want to do it for city,
>
> please help me
>
> --
> 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.
>
>


-- 

*Ankit Rai*

*
*

-- 
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: Advanced Search

2011-05-02 Thread pankaj sharma
thanks.


On May 2, 1:52 am, Ankit Rai  wrote:
> Hi,
>
> Are city and name are the fields of your models?If yes than you can write
> your custom search using queryset , refer search implementation in django
> admin
>
> On Mon, May 2, 2011 at 1:41 PM, pankaj sharma 
> wrote:
>
>
>
>
>
>
>
>
>
> > i am new on django, i want to know how can we make advanced search on
> > our website.
>
> > i have database of colleges. and i want to provide the user to search
> > the colleges by :
> > city and name
>
> > i have made single search where user can enter the query and it will
> > show only those colleges having the query in their names
> > i also want to do it for city,
>
> > please help me
>
> > --
> > 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.
>
> --
>
> *Ankit Rai*
>
> *
> *

-- 
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.



Strange problem with admin, ManyToMany and DEBUG=False

2011-05-02 Thread Nick
Hi,

I'm having a very strange problem with a site I've developed, which
only seems to happen when DEBUG=False and is now preventing my from
launching the site (unless I launch it in DEBUG mode, which I
obviously don't want to).  The EXACT same code works in DEBUG=True,
but with DEBUG=False I get the following error when trying to access
one of my ManyToMany fields:

views.py - FieldError: Cannot resolve keyword 'page' into field.
Choices are: bank_holidays, date_values, finish, id, start, values,
year

I have discovered that if I comment out my admin.autodiscover() line
in urls.py it suddenly starts working again.  I've therefore looked at
my admin.py and simplified it to a very basic example, but this still
doesn't work.  Here are the relevant parts of my code (let me know if
there are any other parts that would be useful to see)...

models.py: http://dpaste.com/hold/537990/
views.py: http://dpaste.com/537991/
admin.py: http://dpaste.com/hold/537993/

So as soon as I try and lookup page.years.all() in my page view I get
an error.  If I don't import any models in my admin.py (I've tried
removing the whole admin.py file) then I can lookup page.years.all()
without any issues.  Weird!  Maybe some sort of circular import issue
or something?  I've been looking at this for 6 hours and can't see a
solution so any help would be great!

I'm using Apache with mod_wsgi in daemon mode and I am touching the
wsgi file to reload the code between test attempts.  I've tried
embedded mode and restarted Apache just incase the changes weren't
being loaded properly, but this gives the same behaviour.  I'm using
Django 1.2.5.

Thanks,
Nick

-- 
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: Strange problem with admin, ManyToMany and DEBUG=False

2011-05-02 Thread Xavier Ordoquy
Le 2 mai 2011 à 11:49, Nick a écrit :

> Hi,
> 
> I'm having a very strange problem with a site I've developed, which
> only seems to happen when DEBUG=False and is now preventing my from
> launching the site (unless I launch it in DEBUG mode, which I
> obviously don't want to).  The EXACT same code works in DEBUG=True,
> but with DEBUG=False I get the following error when trying to access
> one of my ManyToMany fields:
> 
> views.py - FieldError: Cannot resolve keyword 'page' into field.
> Choices are: bank_holidays, date_values, finish, id, start, values,
> year
> 
> I have discovered that if I comment out my admin.autodiscover() line
> in urls.py it suddenly starts working again.  I've therefore looked at
> my admin.py and simplified it to a very basic example, but this still
> doesn't work.  Here are the relevant parts of my code (let me know if
> there are any other parts that would be useful to see)...
> 
> models.py: http://dpaste.com/hold/537990/
> views.py: http://dpaste.com/537991/
> admin.py: http://dpaste.com/hold/537993/


Hi
# some logic which populates the "page" variable with a Page object
This comments make me thinks that you created a new Page object but did not 
save it.
Can you confirm the page object has an id before doing page.years.all() ?

Regards,
Xavier.

-- 
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: Strange problem with admin, ManyToMany and DEBUG=False

2011-05-02 Thread Nick
Hi,

Yes sorry that wasn't clear.  There is basically:

page = get_object_or_404(models.Page, slug=level0)

which varies depending on the number of "level" arguments passed into
the view.  So "page" will always be a lookup of a Page object.

Thanks,
Nick

On May 2, 11:05 am, Xavier Ordoquy  wrote:
> Le 2 mai 2011 à 11:49, Nick a écrit :
>
>
>
>
>
> > Hi,
>
> > I'm having a very strange problem with a site I've developed, which
> > only seems to happen when DEBUG=False and is now preventing my from
> > launching the site (unless I launch it in DEBUG mode, which I
> > obviously don't want to).  The EXACT same code works in DEBUG=True,
> > but with DEBUG=False I get the following error when trying to access
> > one of my ManyToMany fields:
>
> > views.py - FieldError: Cannot resolve keyword 'page' into field.
> > Choices are: bank_holidays, date_values, finish, id, start, values,
> > year
>
> > I have discovered that if I comment out my admin.autodiscover() line
> > in urls.py it suddenly starts working again.  I've therefore looked at
> > my admin.py and simplified it to a very basic example, but this still
> > doesn't work.  Here are the relevant parts of my code (let me know if
> > there are any other parts that would be useful to see)...
>
> > models.py:http://dpaste.com/hold/537990/
> > views.py:http://dpaste.com/537991/
> > admin.py:http://dpaste.com/hold/537993/
>
> Hi
> # some logic which populates the "page" variable with a Page object
> This comments make me thinks that you created a new Page object but did not 
> save it.
> Can you confirm the page object has an id before doing page.years.all() ?
>
> Regards,
> Xavier.

-- 
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.



Artigo bem bem legal ! Using MySQL as a NoSQL

2011-05-02 Thread Sandro Fernandes
http://yoshinorimatsunobu.blogspot.com/2010/10/using-mysql-as-nosql-story-for.html

-- 
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: Strange problem with admin, ManyToMany and DEBUG=False

2011-05-02 Thread Karen Tracey
On Mon, May 2, 2011 at 5:49 AM, Nick  wrote:

> I'm having a very strange problem with a site I've developed, which
> only seems to happen when DEBUG=False and is now preventing my from
> launching the site (unless I launch it in DEBUG mode, which I
> obviously don't want to).  The EXACT same code works in DEBUG=True,
> but with DEBUG=False I get the following error when trying to access
> one of my ManyToMany fields:
>
> views.py - FieldError: Cannot resolve keyword 'page' into field.
> Choices are: bank_holidays, date_values, finish, id, start, values,
> year
>
> I have discovered that if I comment out my admin.autodiscover() line
> in urls.py it suddenly starts working again.  I've therefore looked at
> my admin.py and simplified it to a very basic example, but this still
> doesn't work.  Here are the relevant parts of my code (let me know if
> there are any other parts that would be useful to see)...
>
> models.py: http://dpaste.com/hold/537990/
> views.py: http://dpaste.com/537991/
> admin.py: http://dpaste.com/hold/537993/
>
> So as soon as I try and lookup page.years.all() in my page view I get
> an error.  If I don't import any models in my admin.py (I've tried
> removing the whole admin.py file) then I can lookup page.years.all()
> without any issues.  Weird!  Maybe some sort of circular import issue
> or something?  I've been looking at this for 6 hours and can't see a
> solution so any help would be great!
>

Your ForeignKey fields are using quoted strings for references to models,
this can trigger problems like this (see ticket #10405, though in that
particular case the error message is different). Since you don't seem to
have any need to do that (the Year model is in the same file as the other
models and defined first, so you can just as easily specify Year as "Year"
for the related model in the ForeignKey definitions) I'd stop doing that and
see if the problem goes away.

If not, problems like this also come from intermixing model and form
definitions (see ticket #11247 and the one it was closed dupe of). From a
brief scan I don't see that you are doing that, but you have included an
import of django forms in your models.py which makes me wonder if perhaps
you are doing something like that in the full version of the code. Avoiding
model/form intermixing is then the 2nd thing I'd try to fix the problem.

Karen
-- 
http://tracey.org/kmt/

-- 
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: Strange problem with admin, ManyToMany and DEBUG=False

2011-05-02 Thread Nick
Many thanks for your reply Karen.

I followed your first suggestion, removing quoted strings, which
didn't make a difference.  I don't know why I was importing
django.forms in my models.py as I wasn't using it, so I removed that.

I have now fixed this by simply changing the location of the
admin.autodiscover() line in my urls.py.  Before I had:

from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
import settings
from web.views import *
from web.forms import *
from web.feeds import *
import web.models
from django.views.generic.simple import redirect_to

and NOW I have:

from django.conf.urls.defaults import *
import settings
from web.views import *
from web.forms import *
from web.feeds import *
import web.models
from django.views.generic.simple import redirect_to
from django.contrib import admin
admin.autodiscover()

and it works! :)  Is this a bug I've just stumbled across, or should
admin.autodiscover() always be after models are imported in urls.py?

Thanks,
Nick

-- 
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.



Odp: UnicodeDecodeError with makemessages in django-1.3

2011-05-02 Thread Tomasz Zieliński
I got the same exception, it turned out that our designer put some invalid 
characters into one of the templates.
I figured out which template had been broken, due to the fact that 
`makemessages` left empty `buggy_template.html.py`
 file in `buggy_template.html` folder.

-- 
Tomasz Zielinski
pyconsultant.eu

-- 
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.



500 message with POST

2011-05-02 Thread Robert Cross
I'm a Django newbie and I'm trying to do some minor tests with POST methods
(I need an automated/scriptable way to get data into my Django database).
Using the following code

@csrf_exempt
def posttest(request):
z=request.POST.get('data', 'no data')
html="POST TestData supplied was \""
html=html+z
html=html+"\""
return HttpResponse(html)

When I run a test upload it fails:

$ wget --post-data 'data=Something'
http://localhost:8000/posttest?data=Command
Line
--2011-05-02 15:30:03--  http://localhost:8000/posttest?data=CommandLine
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:8000... connected.
HTTP request sent, awaiting response... 500 INTERNAL SERVER ERROR
2011-05-02 15:30:03 ERROR 500: INTERNAL SERVER ERROR.

If I don't supply any post data then it appears to work (301 followed by 200
codes, but still gives the expected html).

Any ideas what I'm doing wrong? (Get methods seem to work - but I'd prefer
not to use them because they're not technically correct for a DB update
function)

Thanks, Bob.

-- 
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: 500 message with POST

2011-05-02 Thread А . Р .
> @csrf_exempt


> Any ideas what I'm doing wrong?

Try importing csrf_exempt at the top of your views.py:
from django.views.decorators.csrf import csrf_exempt

-- 
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: Overwriting the handler404

2011-05-02 Thread Jason Culverhouse

On May 1, 2011, at 8:01 AM, doniyor wrote:

> Hi there,
> i am trying to overwrite handler404 of django so that i can call my
> own view function when it doesnot find the appropriate view and if it
> tries to give Http404. the whole problem is as follows:
> 
> i defined my view function called 'remap_test' in my proxy app. and i
> changed the default handler404 to handler404 =
> 'proxy.views.remap_test'.
> The problem is that it gives all the time 404 error even if the
> handler404 is defined right and even if it is in right place(in
> urls.py) and the settings.py has the DEBUG = FALSE and my new view
> function is theoretically ready to be called. but it isnot called,
> sometimes it is. it is sooo weird.
> 
> i will post here the code blocks i added:
> 
> in my urls.py is this:
> 

You problem statement is a little confusing, so I'm not sure I am on the right 
track here

Just a quick thought, 
Does your urls.py contain 
from django.conf.urls.defaults import *

If you are missing the "import *" the handler404 function that your are 
assigning to 

> handler404 = 'proxy.views.remap_test'
> .

will just be a local variable and not django.conf.urls.defaults.handler404

Jason

> 
> 
> and my view function is this:
> 
> def remap_test(request):
>   return HttpResponse("test message as 404")
> 
> and my model is this:
> 
> class Remap(models.Model):
>new_url = models.CharField(max_length=50)
>src_url = models.CharField(max_length=150)
>def __unicode__(self):
>return self.src_url
> 
> ... i dont know why it calls 404 all the time, sometimes i get the
> problem if i add items to my database tables in admin, and sometimes
> not. can someone please help me with this or does anyone have an idea
> what the problem could be ?
> 
> thank you guys so much in advance,
> 
> doni
> 
> -- 
> 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.
> 

-- 
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: 500 message with POST

2011-05-02 Thread Ian Clelland
On Mon, May 2, 2011 at 7:45 AM, Robert Cross  wrote:

> I'm a Django newbie and I'm trying to do some minor tests with POST methods
> (I need an automated/scriptable way to get data into my Django database).
> Using the following code
>
> @csrf_exempt
> def posttest(request):
> z=request.POST.get('data', 'no data')
> html="POST TestData supplied was \""
> html=html+z
> html=html+"\""
> return HttpResponse(html)
>
> When I run a test upload it fails:
>
> $ wget --post-data 'data=Something'
> http://localhost:8000/posttest?data=Command
> Line
> --2011-05-02 15:30:03--  http://localhost:8000/posttest?data=CommandLine
> Resolving localhost (localhost)... 127.0.0.1
> Connecting to localhost (localhost)|127.0.0.1|:8000... connected.
> HTTP request sent, awaiting response... 500 INTERNAL SERVER ERROR
> 2011-05-02 15:30:03 ERROR 500: INTERNAL SERVER ERROR.
>
> If I don't supply any post data then it appears to work (301 followed by
> 200 codes, but still gives the expected html).
>
> Any ideas what I'm doing wrong? (Get methods seem to work - but I'd prefer
> not to use them because they're not technically correct for a DB update
> function)
>
>
I'm not sure where the 500 error is coming from -- if you can get wget to
show you the HTTP response, then you should be able to see the actual error
and traceback in there (as long as you have DEBUG enabled, you should get
back a formatted HTML document with the error message in it)

If you can't get the error output, then try at least printing the html
variable before the view function returns. You'll at least know if if gets
that far, or if the error is happening somewhere else. Just watch the
console where your server is running, and you should see the output of any
print statements.

The fact that, on GET, you are getting a 301 first means that the URL that
you are providing is not the correct one for the resource. You probably have
"/posttest/" defined in your urls.py, but you are using wget to access
"/posttest" (no trailing slash). On a GET request, it is perfectly safe to
just issue a redirect to the correct URL, but it is not necessarily safe for
POST requests. I believe that Django will issue the redirect anyway, buy the
user agent is *not* supposed to just blindly post the data to the new URL
without some sort of user interaction.

To eliminate this as a possible error source, try putting the trailing "/"
on the URL in the command line:

$ wget --post-data 'data=Something'
http://localhost:8000/posttest/?data=CommandLine

Then you should get { 'data': 'CommandLine' } in request.GET, and { 'data':
'Something' } in request.POST.

-- 
Regards,
Ian Clelland


-- 
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: Input element radio button group across rows of change list view in Admin?

2011-05-02 Thread creecode
Hello all,

If you happen to know of an existing app w/online source that has an admin 
interface similar to what I want, pointers appreciated!

-- 
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.



Problem uploading images and videos with filenames containing not ascii characters

2011-05-02 Thread Ariel
Hi everybody:

How Can I solve this, I have a form to upload videos and images but when a
video or image with a filename containing not ascii characters is uploaded
then I get the following error:
Django Version: 1.2.1  Exception Type: UnicodeEncodeError  Exception Value:

'ascii' codec can't encode characters in position 65-68: ordinal not
in range(128)

 Exception Location: /usr/lib/python2.5/posixpath.py in exists, line
171  Python
Executable: /usr/bin/python  Python Version: 2.5.2
How can I solve this problem ???
Any help is really appreciatte it.

Regards,
Ariel

-- 
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.



Problem with Geometries

2011-05-02 Thread George Silva
Hello guys

I'm having a problem with Geodjango, a weird exception happening, not sure
why.

Well, my setup is the following:

Windows 7 64bit
GeoDjango installed from Windows Installer.

Here is a traceback when I try to store a common object using the admin

http://dpaste.com/538214/

My model is simple:

class Neighborhood(models.Model):
neighborhood_name = models.CharField(max_length=128,verbose_name="Nome
do bairro",help_text="Nome descritivo do bairro, e.g. Itaim Bibi, Pinheiros,
etc.")
neighborhood_geom =
models.PolygonField(verbose_name="Geometria",help_text="O polígono
representativo do limite do bairro")

objects = models.GeoManager()

class Meta:
verbose_name = "Bairro"
verbose_name_plural = "Bairros"

admin.site.register(Neighborhood,admin.GeoModelAdmin)

Any one can help?

TIA

-- 
George R. C. Silva

Desenvolvimento em GIS
http://geoprocessamento.net
http://blog.geoprocessamento.net

-- 
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.



how to add datepicker (available in admin)

2011-05-02 Thread GKR
how to add datepicker (available in admin) into my custom page for date 
input form field.

-- 
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: how to add datepicker (available in admin)

2011-05-02 Thread Kenneth Gonsalves
On Mon, 2011-05-02 at 18:21 -0700, GKR wrote:
> how to add datepicker (available in admin) into my custom page for
> date 
> input form field. 

easier to use jquery datepicker (admin datepicker does not change years)
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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: Form with manytomany field

2011-05-02 Thread Daniel França
anyone?
Maybe what I need is something like OneToMany relationship, i guess, but
there's no such thing in django

2011/5/2 Daniel França 

> Hi all,
> I'm trying to create a form from a model with ManyToManyField,
> I want something like this: You fill some fields from the referenced table
> and you click at 'Add' and this appears at a table below the fields, so when
> I click
> "Save" all the added items save (includind the new manytomany items)
>
> Example:
>
> *Name [  ]*
> *Email [  ]*
>
> *Add Companys you've Worked for:*
> *Company [   ]  Telephone [
>  ]   (ADD Button)*
> *
> 
> *
> *CompanyTelephone*
> *Company XYZ  555 0123*
> *Company ABC  123 4567*
> *
> *
> *(Save Form Button)*
> *
> *
>
> I hope you can understand this... there's some easy way to implement this
> using Django?
>
> Best Regards,
> Daniel França
>
>

-- 
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.



Makemessages Multiline

2011-05-02 Thread momo2k
I'm using Django for about a year by now and I'm using translation
since users of my website are mixed german/english speaking.

makemessages works well on Windows, but on Debian 5 it doesn't work
with multiple line messages and I can't figure out why. I'm sure it's
a simple problem, but I don't get it :(


self.message = _('This is some error message, '
 'multiple lines!')

On windows:
msgid "This is some error message, multiple lines!"

Linux
msgid "This is some error message, "

There are newlines after the "'" and ")", backslash or plus after the
first line doesn't help...

-- 
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.



django searching

2011-05-02 Thread pankaj sharma
hello all,
i am trying to have an advanced search..
i have college list where there are many tables in college like
college.name, collge.city college.state etc.

so i have taken two strings from the user  like   Q1 and Q2.
now i want to show all the colleges which have Q1 string in name and
Q2 string in city..
basically i want to add "and" & "or" statement in this statement :


college_list = College.objects.filter(name__icontains=Q1)


so i want to add  one another filter   like  (city__icontains=Q2)

anyone please tell me..
thanks in advance

-- 
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: django searching

2011-05-02 Thread Jani Tiainen
On Mon, 2011-05-02 at 21:40 -0700, pankaj sharma wrote:
> hello all,
> i am trying to have an advanced search..
> i have college list where there are many tables in college like
> college.name, collge.city college.state etc.
> 
> so i have taken two strings from the user  like   Q1 and Q2.
> now i want to show all the colleges which have Q1 string in name and
> Q2 string in city..
> basically i want to add "and" & "or" statement in this statement :
> 
> 
> college_list = College.objects.filter(name__icontains=Q1)
> 
> 
> so i want to add  one another filter   like  (city__icontains=Q2)
> 

You didn't really specified do you want AND query or OR query.

And query is simple:

college_list = College.objects.filter(name__icontains=Q1,
city__icontains=Q2)

Or query is sligthly different but not much, you need to use Q-objects
for that (they're very powerful beings, you should read about them in
the docs.)

college_list = College.objects.filter((Q(name__icontains=Q1) |
Q(city__icontains=Q2))

Hope that helps.

-- 

Jani Tiainen


-- 
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.