Re: Using Tag Filters in a generic view

2012-08-23 Thread Carlos Palol
Hi, please share your view class. Cheers On Thursday, 23 August 2012 18:56:37 UTC+2, miked wrote: > > I have create a generic view and in that view I have specified > context_object_name of errata_id_list in this case. This generic view is > tied to a query set of a model and in the view I s

database file doesn't increase in size

2012-08-23 Thread heni yemun
Hi, When i create a user account, fill the fields with some value and save() it in the database file *myfile.db* for example, the file doesn't show any change in size. So how do i know if i'm actually saving it and can later access the values? Or is there another problem i should deal with firs

After form validation, need to post and call a perl program to display to a log file

2012-08-23 Thread Pervez Mulla
Hi, I have written code for form validation for different filed . Once validation happened (its working good), I wanna call perl script to disply it content to lof file ... How can I do this ..?? Please help me Pervez -- You received this message because you are subscribed to the Google

Re: Django-tables2

2012-08-23 Thread Alex Strickland
On 2012/08/24 01:49 AM, MattDale wrote: I love django-tables2! May I ask why? I'm not trolling, I'd like to know more about it. -- Regards Alex -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-user

How to set language switcher links of django?

2012-08-23 Thread kevon wang
Every language show its own language links in one page, such as the Language switcher links of FaceBook and Google. Language switcher links like this : - English (US) - Español - Português (Brasil) - Fr

Re: GeometryField in OSMGeoAdmin

2012-08-23 Thread geonition
Hi, I do see your point Melvyn but my use case only requires to save different types of geometries and visualize them. Anything more usefull is just extra. This works fine when i build the map myself but the OpenLayersWidget has this geomtype restriction. The complexity in saving geometries of

Django-tables2

2012-08-23 Thread MattDale
Your answer is LinkColumn instead of TemplateColumn. You can pass Args and kwargs with this in your table. I'll post an example of this when I get home. It's quite simple. I love django-tables2! -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: django.db.utils.DatabaseError when resyncing django app models

2012-08-23 Thread Melvyn Sopacua
On 23-8-2012 4:53, Mhlanga Bothin wrote: > > On 23/08/2012, at 10:59 AM, Melvyn Sopacua wrote: > >> On 23-8-2012 2:37, Mhlanga Bothin wrote: >> >>> Thanks a lot for your help. I am not adding any classes to the app on >>> the second sync, correct me if I am wrong but django only resyncs new >>> c

Re: GeometryField in OSMGeoAdmin

2012-08-23 Thread Melvyn Sopacua
On 23-8-2012 10:41, geonition wrote: > It is very convenient for me to use GeometryField as I can save any > geometry type into the same field. The database logic will become more > complex if I am required to create a separate table or field for e.g. > points and linestrings. > > Still lookin

Re: runserver error: "No module named app3"

2012-08-23 Thread Alexis Bellido
I'd suggest you decouple your apps from your projects. If you want to have everything under the same tree you could, I don't do it that way though. You could have a tree like this: /home/user --proj proj (this contains settings.py in Django 1.4) app1 app2 --app3 You already noticed

Re: What happens when you use ``select_for_update`` with ``select_related``?

2012-08-23 Thread Joseph Mutumi
I'm not sure but you can look at the generated query and post it to the relevant database mailing list? Go in through: manage.py shell then follow instructions in FAQ https://docs.djangoproject.com/en/dev/faq/models/#how-can-i-see-the-raw-sql-queries-django-is-running On Mon, Aug 20, 2012 at 6:0

Re: Distinct Values in ModelChoiceField

2012-08-23 Thread Joseph Mutumi
@Melvyn Thank you. It actually worked out as you said. It needed a redesign. On Wed, Aug 22, 2012 at 1:44 PM, Sithembewena Lloyd Dube wrote: > @Melvyn, thanks - that makes sense. > > > On Wed, Aug 22, 2012 at 3:18 AM, Melvyn Sopacua wrote: > >> On 22-8-2012 3:04, Sithembewena Lloyd Dube wrote: >>

Re: Models relationship

2012-08-23 Thread Kurtis Mullins
Hello Fernando, Just as a quick example, you could do something like this: class Factory(models.Model): # Assuming suppliers and customers are just two sides of the same relationship suppliers = models.ManyToManyField("self", related_name="customers") Then simply query accordingly: fact

Django-tables2

2012-08-23 Thread Roberto Ferreira Junior
Hi All, I would like to ask something, I´m trying to render a table using Django-tables2 and that table has a link column that I want to link with another page, I cant figure out how can I link my model, and pass my PK to url.py. Here’s My code: ## Models.py: ##

Re: GeometryField in OSMGeoAdmin

2012-08-23 Thread Satinderpal Singh
Hi, I also start working on the the OSM in Geodjango and i am not much familiar with it. I installed libraries like geos and starts a project by following the instructions in the geodjango gide. But it only tells, how to install libraries, my question is that how will i make map in my project? Is t

Using Tag Filters in a generic view

2012-08-23 Thread miked
I have create a generic view and in that view I have specified context_object_name of errata_id_list in this case. This generic view is tied to a query set of a model and in the view I specify the list of keys I would like to display. Here is a snippit from the template: {% for record in err

Re: custom field for callable python object like class or function

2012-08-23 Thread Michael Palumbo
Maybe using a Model like Kurtis mentioned will be better (and easier) than making a custom field... ? Le jeudi 23 août 2012 18:49:55 UTC+2, Michael Palumbo a écrit : > > I did not know the pickle module. This is interesting. Thanks. > However, after playing with it, I am not sure it fits totally

Re: custom field for callable python object like class or function

2012-08-23 Thread Michael Palumbo
I did not know the pickle module. This is interesting. Thanks. However, after playing with it, I am not sure it fits totally my need because I'd like humans to be able to write a string like "modulea.moduleb.MyClass" in the admin or so. So I kept trying making a custom field (instead of a Model)

Re: Can somebody help me on how to handle this scenario?

2012-08-23 Thread Nirmal Sharma
Thanks everybody for your help. I will try what you have suggested and will come back with some more questions. On Wednesday, August 22, 2012 4:57:47 PM UTC-7, Melvyn Sopacua wrote: > > Hi Nirmal, > > I'll try to answer your question instead of assuming you're working with > django's auth syste

Re: Problems Adding Django South Tool

2012-08-23 Thread Fyodor Wolf
What was your Solution??? -- 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/-/kW9P46ybVnYJ. To post to this group, send email to django-users@googlegroups.com.

Re: CACHE_MIDDLEWARE_ANONYMOUS_ONLY does not work if user is not printed by view or template

2012-08-23 Thread Alexis Bellido
Ok, I just confirmed my "problem" was caused by Django lazy loading the User object. To confirm it, I just added something like this to my view: test_var = "some text" + request.user And I got an error message telling me I couldn't concatenate an str to a SimpleLazyObject. At this point the la

Re: error in the order form

2012-08-23 Thread Amyth Arora
The reason you are getting this error is because the 'TO' argument you're passing to send_mail is not a list but a string. you're calling the send_mail function using send_mail(name, email, tema, summa) and here the TO argument you are passing is 'email' which is not a list of recipients but the s

error in the order form

2012-08-23 Thread Владислав Иванов
Developing an order form. Shows the error "to" argument must be a list or tuple Please tell me that I not correct? I need the user to be online to complete this form and the order came to my email *views.py* #-*-coding:utf-8-*- from django.db import models from django import forms from djang

Models relationship

2012-08-23 Thread Fernando Andreacci
Hello, I'm a new Django user, and I have the following question: I have one Model called *factory, *with several fields like (name, address, phone, etc). Each factory can be a customer, a supplier or both. Ex: Factory1 is a customer of Factory2, and Factory1 is a supplier of Factory3. How can

Re: CACHE_MIDDLEWARE_ANONYMOUS_ONLY does not work if user is not printed by view or template

2012-08-23 Thread Alexis Bellido
Hi, Yeah, the optimization approach makes sense but it's misleading as the settings says CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True, which makes you think that every view that is requested by an authenticated user is non-cached. I haven't finished working on my templates and views yet but I will p

Re: What is the easy way to install DJango?

2012-08-23 Thread baldyeti
Overall it is less problematic to get any python library to work on linux than windows, no doubt. But an alternative which I have not seen mentioned yet is using the ActiveState python distribution. Their "pypm" package manager can tap into their repository of pre-built extensions (see http://co

Re: GeometryField in OSMGeoAdmin

2012-08-23 Thread geonition
Hi, It is very convenient for me to use GeometryField as I can save any geometry type into the same field. The database logic will become more complex if I am required to create a separate table or field for e.g. points and linestrings. Still looking for a workaround, or is there a reason for

How to use URL namespaces in tests?

2012-08-23 Thread e.generalov
Url patterns which provided by a django application should be addressedexternally in the form of "namespace:name". I guess it will be connected to the project as follows: project/urls.py urlpatterns = patterns('', url('^something/', include('django_something.urls', namespace='something'))

Re: What is the easy way to install DJango?

2012-08-23 Thread Jani Tiainen
23.8.2012 2:08, Demian Brecht kirjoitti: Or installing the M$ VC++ Express edition compatible with the version used for the Python build -- Wulfraed Dennis Lee Bieber AF6VN wlfr...@ix.netcom.com H

Re: How to use Django with Apache and mod_wsgi

2012-08-23 Thread Joris
Op woensdag 22 augustus 2012 23:05:03 UTC+2 schreef stikic het volgende: > > Then do I have to delete 00_default_vhost.conf file? > What name can I give to this new created file? > > Well you have not referred or included 00_default_vhost.conf in your httpd.conf so this file is not actually rea

Re: database error and connection._rollback

2012-08-23 Thread Mike Dewhirst
On 23/08/2012 4:27pm, akaariai wrote: On 23 elo, 08:30, Mike Dewhirst wrote: This ... [1] from django.db import connection connection._rollback() ... solved a problem for me in unit testing when I catch a deliberate DatabaseError. Django 1.4 Python 2.7 PostgreSQL 9.1 My question: Is it safe

Re: to_field can not use primary key of related object.

2012-08-23 Thread Jani Tiainen
23.8.2012 9:30, yillkid kirjoitti: HI all. I write a model: class UserGroup(models.Model): groups = models.ForeignKey(Group, to_field='id') and when I into admin backend: Ac