Re: Attributr error

2010-11-02 Thread sami nathan
I want my final result in xml format and how can i do that? thanks for notification -- 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

Re: admin usage

2010-11-02 Thread Carlos Daniel Ruvalcaba Valenzuela
Probably so, we do have stuff that tends to be JavaScript intensive at times, in some places we have a few AJAX queries (for example selecting a warehouse and loading the relevant part numbers for the next field based on the client) that may not be necessary, to stuff like Maps with OpenLayers for

Re: Import csv file in admin

2010-11-02 Thread Jorge
Jirka & Everybody Back to basics is always a good advice. With your help and this guy: http://www.beardygeek.com/2010/03/adding-views-to-the-django-admin/ I can create a form to upload csv files and input their records into the database. Short history: Forms.py: class DataInput(forms.Form):

Re: Query help

2010-11-02 Thread Itai Tavor
On 03/11/2010, at 2:10 AM, Prashanth wrote: > > > On Tue, Nov 2, 2010 at 9:35 AM, Itai Tavor wrote: > Hi people, > > Given this: > > class Category(models.Model): >name = models.CharField() >parent = models.ForeignKey('self', blank=True, null=True) >tree_path

Re: Empty Response

2010-11-02 Thread adelein
You can easily look at the request/response by using firebug. TIP: Notice if there is a redirect. Sometimes depending on the config, for example, if django is set to append a / at the end, meaning it will do a redirect, then your request or response might be getting lost in the redirect (an HTTP

Re: Admin without template (no colors, no css, just simple html)

2010-11-02 Thread marcoarreguin
I have made somthing like: ln -s $HOME/.local/lib/python2.6/site-packages/django/contrib/admin/ media $HOME/.public_html/media And this create a folder with three folders more in my public_html (js, css, images) but it still don't working. also I do: ln -s

Re: Change the initial data to a modelForm

2010-11-02 Thread refreegrata
This don't work to me. Now I must to use the "." like a thousand separator and the "," like decimal separator (x.xxx,xx) (requirement of the boss). I try to follow the guide to "custom format fields" in the Django documentation, but I can't get formatted numbers. I have this:

RE: manage.py sqlall and db upgrade

2010-11-02 Thread Sells, Fred
I believe it failed because I changed the tablename in the meta data and that may have conflicted with some tables my boss inserted usring raw sql and basic programming language. -Original Message- From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com] On Behalf Of

Re: Admin without template (no colors, no css, just simple html)

2010-11-02 Thread marcoarreguin
How can I create that symbolic link? :S __ On Oct 26, 7:07 am, Daniel Roseman wrote: > On Oct 26, 1:25 pm, Giancarlo Razzolini wrote: > > > I had this same problem when hosting it with apache. I solved the > > problem by creating a symbolic

Re: html in django password_reset_email.html

2010-11-02 Thread andy
On Nov 2, 4:50 am, Tom Evans wrote: > On Tue, Nov 2, 2010 at 9:07 AM, andy wrote: > > I recently tried to send the following in a test password email from a > > site I am creating: > > > This is a test reset password email. > > > However when I

Re: Empty Response

2010-11-02 Thread Reinout van Rees
On 11/02/2010 09:29 PM, Eric wrote: I am returning a json structure in one of my views after the user performs a search when I only run Django's built in server. Following the asynchronous GET I get a response with the expected json structure which I can then use to populate the page. However,

Re: html in django password_reset_email.html

2010-11-02 Thread andy
On Nov 2, 4:50 am, Tom Evans wrote: > On Tue, Nov 2, 2010 at 9:07 AM, andy wrote: > > I recently tried to send the following in a test password email from a > > site I am creating: > > > This is a test reset password email. > > > However when I

Re: html in django password_reset_email.html

2010-11-02 Thread andy
On Nov 2, 4:50 am, Tom Evans wrote: > On Tue, Nov 2, 2010 at 9:07 AM, andy wrote: > > I recently tried to send the following in a test password email from a > > site I am creating: > > > This is a test reset password email. > > > However when I

Re: html in django password_reset_email.html

2010-11-02 Thread andy
On Nov 2, 4:50 am, Tom Evans wrote: > On Tue, Nov 2, 2010 at 9:07 AM, andy wrote: > > I recently tried to send the following in a test password email from a > > site I am creating: > > > This is a test reset password email. > > > However when I

Re: Validate single field in model

2010-11-02 Thread Jirka Vejrazka
> But can i do something similar in the Model itself ? Hi, have you checked the documentation? http://docs.djangoproject.com/en/dev/ref/models/instances/#validating-objects Cheers Jirka -- You received this message because you are subscribed to the Google Groups "Django users"

Struggling with aggregation/annotation

2010-11-02 Thread Oliver Andrich
Hi, currently I am moving my django project towards Django 1.2. During that step I want to replace code like that query_set = query_set.extra(select = { 'image_count': '''SELECT COUNT(*) FROM image WHERE topic.id = image.topic_id

Validate single field in model

2010-11-02 Thread Jakob Olsen
Hello, I try to validate a single field in a model. I know I can validate the field in a ModelForm like: def clean_FIELDNAME(self): if self == 'This is a test': raise forms.ValidationError("ValidationError") But can i do something similar in the Model itself ? -- You received this

Re: 2D map application: performance and design question

2010-11-02 Thread Knut Ivar Nesheim
I would suggest rewriting the loop in your template as a templatetag. Something like this @register.simple_tag def render_locations(locations): html = u""" html %(x)s stuff %(y)s here %(link)s """ return '\n'.join([html % { 'x': loc.x, 'y': loc.y', 'link': loc.link } for loc in

Re: Change the initial data to a modelForm

2010-11-02 Thread refreegrata
Thanks, you are the best -- 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

Empty Response

2010-11-02 Thread Eric
I am returning a json structure in one of my views after the user performs a search when I only run Django's built in server. Following the asynchronous GET I get a response with the expected json structure which I can then use to populate the page. However, when I have Apache in front, the

Re: 2D map application: performance and design question

2010-11-02 Thread Lars Ruoff
Ok, thanks for the suggestion, Javier. I implemented this and it showed: I'm spending about 0.2 secs for the queries, but 1.5 secs for t.render(c) ! So rendering the template seems to take a significant amount of time! As you can see, my template code iterates over about 13*13=169 objects that

Re: Change the initial data to a modelForm

2010-11-02 Thread Shawn Milochik
I don't think you need to change the value, but rather add localization so add proper formatting. http://docs.djangoproject.com/en/dev/topics/i18n/localization/#format-localization -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Change the initial data to a modelForm

2010-11-02 Thread refreegrata
Hello list. I have a model "PP" with a "float" field "val" and a modelform for this model For update the data of a existent "PP" I use a form like this Form_for_PP(request,POST, instance=instance) Now my question is, Can I change the initial data for the field "val"? I want to do this: If

Re: manage.py sqlall and db upgrade

2010-11-02 Thread Michael
It would be in your benefit to learn why South failed, because it's been very stable for me, and may be an indication of something else being wrong with your app and/or models. -- Michael On Tue, 2010-11-02 at 15:27 -0400, Sells, Fred wrote: > I've got my first major django

manage.py sqlall and db upgrade

2010-11-02 Thread Sells, Fred
I've got my first major django production app deployed and have to upgrade my DB to meet some new requirements. I've tried South, but got into a death spiral and my changes are not so significant that I can't do it by brute force. In researching brute force, it seems like syncdb loads my initial

Re: Repost Admin Site Without Graphics

2010-11-02 Thread James
So your admin media (js, css, images, etc) isn't working? Try two things: 1. Open the source of some admin page. Look at some image, css, or js object. Find the path where it is pointing. Does this path makes sense? (Have you put it in the settings.py file?) 2. Check your site settings. If you

Re: Trying to determine the duplicate SQL queries from my view code

2010-11-02 Thread Matteius
OK so I have solved this, the flaw being my understanding of the cacheing of Django database QuerySets. I still have not eliminated the double auth_user request because one is made in the @login_required directive and the other is made in the view code to pass user data to the template. However

Re: admin usage

2010-11-02 Thread derek
And my thoughts are echoed in this parallel thread I just came across: http://groups.google.com/group/django-users/browse_thread/thread/935d64cb03730b73 On Nov 2, 9:12 pm, derek wrote: > I always had the opposite impression. The Admin can be modified quite > extensively to

Re: admin usage

2010-11-02 Thread derek
I always had the opposite impression. The Admin can be modified quite extensively to handle most cases for regular, on-going, data entry for multiple models. This means you have consistency and built-in cohesiveness (less chance for errors because you are using existing code). Its for specialised

How to log all the error and warning messages with apache ???

2010-11-02 Thread Ariel
Hi everybody: This is a configuration question I am having an error in a django website that is hosted in a debian apache mysql server, I have DEPLOY_DEBUG = True but the error is not showed when is raised, I have searched in some logs files like /var/log/syslog , error.log and access.log but the

Re: Mod_Python and everything loaded, Apache serving HTML files without using Django first

2010-11-02 Thread Andy
This isn't directly related to your question, but mod_python is not a recommended method of deploying Django. Support for it will be deprecated. You might want to check out mod_wsgi. On Nov 1, 5:15 pm, The End wrote: > I've finally got mod_python and mysqldb working with

Re: Mod_Python and everything loaded, Apache serving HTML files without using Django first

2010-11-02 Thread The End
Yeah i managed to get it all working before this ended up being posted. Thank you though. Also i host my stuff in different directories. Templates are served from /srv/www/sweetman, while my project code is stored in / sweetman_live/sweetman. So yeah. Thank you. I'm just fiddling with

Re: Django Country->State->City Dropdown list

2010-11-02 Thread d
Thanks. I can't find intuitive examples. Can anyone post a little simple code -- 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

Physical / Logical Hrefs

2010-11-02 Thread octopusgrabbus
Given the following in my main page template how does Django process logout? I am asking this, because I want an href to take an authenticated user to a page that, for example, allows the collection of some data (billing reads). I have an application within the project that will handle read

Re: Django Country->State->City Dropdown list

2010-11-02 Thread Jirka Vejrazka
> The following is my django code. I would like to have 3 column drop- > down list. It sounds like you might want to check out Dajax (http://www.dajaxproject.com/), Dojango (http://code.google.com/p/dojango/) or JQuery (there are plenty of examples for using JQuery with Django out there).

Re: Executing ssh scripts with django

2010-11-02 Thread Sævar Öfjörð
> Would you execute the save function through celery? Is it safe? or maybe if > save() is executed asynchronously it can cause some unexpected behavior? You could use signals to trigger execution of celery tasks, e.g. the post_save signal:

Re: Django Country->State->City Dropdown list

2010-11-02 Thread John Matthew
Sounds like AJAX is your answer, there are lots of AJAX libraries out there that have examples on this. J On Nov 2, 10:31 am, d wrote: > URGENT! > The following is my django code. I would like to have 3 column drop- > down list. > > a member can select his location. >

Django Country->State->City Dropdown list

2010-11-02 Thread d
URGENT! The following is my django code. I would like to have 3 column drop- down list. a member can select his location. when a country is selected, then all states for that country will display. the same thing happens to city. Now, I know it has something to do with Javascript. The question is

rabbitmq + celery + django + celery.views.task_status ... simple example?

2010-11-02 Thread wawa wawawa
Hi All, So, I've got my django app, rabbitmq and celery working and processing my uploaded files. Next step is to get the client to display status results provided by JSON, ultimately refreshing to a results page when complete. I'm a little new to JSON / AJAX (AJAJ!) and I'm struggling a little

Re: Repost Admin Site Without Graphics

2010-11-02 Thread octopusgrabbus
Tried suggestions, and still do not get full graphics. Everything else works. Users are displayed, and so on. On Nov 2, 12:24 pm, octopusgrabbus wrote: > Thanks. I'll try your suggestions. I am using the phrase no graphics > to mean the admin site comes up, but doesn't

Re: Repost Admin Site Without Graphics

2010-11-02 Thread octopusgrabbus
Thanks. I'll try your suggestions. I am using the phrase no graphics to mean the admin site comes up, but doesn't have all the nice background. On Nov 1, 3:41 pm, Robbington wrote: > Hi, > > By 'with out graphics' do you mean no css or Javascript? > > If so you want to

Re: 2D map application: performance and design question

2010-11-02 Thread Javier Guerra Giraldez
On Tue, Nov 2, 2010 at 3:35 AM, Lars Ruoff wrote: > Ok, so having excluded SQLite and the static served files, I'd like to > test if the server matters. What would be a minimum Apache install and > config to run Django locally (on Windows)? again, that's _very_ unlikely to

Re: Query help

2010-11-02 Thread Prashanth
On Tue, Nov 2, 2010 at 9:35 AM, Itai Tavor wrote: > Hi people, > > Given this: > > class Category(models.Model): >name = models.CharField() >parent = models.ForeignKey('self', blank=True, null=True) >tree_path = models.CharField() # //.../// > > class

Re: Attributr error

2010-11-02 Thread Tom Evans
On Tue, Nov 2, 2010 at 1:00 PM, sami nathan wrote: > THIS IS HOW MY URL.PY LOOKS LIKE > > from django.conf.urls.defaults import * > from it.view import current_datetime > > > > # Uncomment the next two lines to enable the admin: > #from django.contrib import admin >

Re: od-erdene

2010-11-02 Thread brano
do not use {% if qs %} {% endif %} use {% for q in qs %} {% empty %} {% endfor %} then it will work Brano On Nov 2, 1:50 pm, Odkoo Ch wrote: > hi everyone > > >     >      {% if qs %} >        {% autopaginate qs 5 %} >             {% for q in qs %} > >      

Re: Is it madness to process uploaded tars and zips completely in memory?

2010-11-02 Thread wawa wawawa
On 2 November 2010 14:03, Cal Leeming [Simplicity Media Ltd] wrote: > All depends on whether; > > you have enough memory > you are going to enforce the file size > you have appropriate resource limitations in place on the server > you are going to enforce the

Re: Is it madness to process uploaded tars and zips completely in memory?

2010-11-02 Thread Cal Leeming [Simplicity Media Ltd]
All depends on whether; - you have enough memory - you are going to enforce the file size - you have appropriate resource limitations in place on the server - you are going to enforce the maximum number of processing requests etc etc... Personally, if all those conditions were met,

Attributr error

2010-11-02 Thread sami nathan
THIS IS HOW MY URL.PY LOOKS LIKE from django.conf.urls.defaults import * from it.view import current_datetime # Uncomment the next two lines to enable the admin: #from django.contrib import admin #admin.autodiscover() urlpatterns = patterns('', # Example:

Is it madness to process uploaded tars and zips completely in memory?

2010-11-02 Thread wawa wawawa
Hi, I am writing an app to "apply some rainbows and unicorns" to a bunch of uploaded XML files (which can be uploaded as a compressed tar or zip file). Celery and rabbitmq will be used for the asynchronous tasks with jQuery (maybe with dajaxproject) to get updates on progress to the browser. I'm

page back

2010-11-02 Thread Odkoo Ch
hi everyone {% if qs %} {% autopaginate qs 5 %} {% for q in qs %} {% endfor %} {% paginate %} {% endif %} I'm using Django Forms to do a filtered/faceted search via POST, and I

od-erdene

2010-11-02 Thread Odkoo Ch
hi everyone {% if qs %} {% autopaginate qs 5 %} {% for q in qs %} {% endfor %} {% paginate %} {% endif %} -- You received this message because you are subscribed to the Google

Re: ATTRIBUTE ERROR

2010-11-02 Thread Tom Evans
On Tue, Nov 2, 2010 at 11:08 AM, sami nathan wrote: > If i am doing anything wrong forgive me i am newbe > > > MY error is > Exception Type:         AttributeError > Exception Value: > > 'str' object has no attribute 'resolve' > > Exception Location: >        

Django: How to get field value dynamically using custom template tags?

2010-11-02 Thread Duy
I recently got a problem where I need to get field's value automatically using templatetags.The idea follows which mentioned in the book "Practical Django Project 2nd Edition", but the book version is getting a list of objects where I want to get only a object's value. I want to get the site

Query help

2010-11-02 Thread Itai Tavor
Hi people, Given this: class Category(models.Model): name = models.CharField() parent = models.ForeignKey('self', blank=True, null=True) tree_path = models.CharField() # //.../// class Item(models.Model): name = models.CharField() categories =

ATTRIBUTE ERROR

2010-11-02 Thread sami nathan
If i am doing anything wrong forgive me i am newbe MY error is Exception Type: AttributeError Exception Value: 'str' object has no attribute 'resolve' Exception Location: D:\Python25\lib\site-packages\django\core\urlresolvers.py in resolve, line 25 My url.py look

Re: html in django password_reset_email.html

2010-11-02 Thread Tom Evans
On Tue, Nov 2, 2010 at 9:07 AM, andy wrote: > I recently tried to send the following in a test password email from a > site I am creating: > > This is a test reset password email. > > However when I received the email it displayed the "This is a test > reset password email.".

Re: django-voting url pattern

2010-11-02 Thread Daniel Roseman
On Nov 1, 3:08 pm, Sithembewena Lloyd Dube wrote: > Thanks Daniel, makes sense. Also, I was making the mistake of thinking that > I had to create a separate view, forgetting that I am calling the one > supplied by django-voting. That correct? I'm not familiar with

Re: 2D map application: performance and design question

2010-11-02 Thread Kenneth Gonsalves
On Tue, 2010-11-02 at 01:35 -0700, Lars Ruoff wrote: > Ok, so having excluded SQLite and the static served files, I'd like to > test if the server matters. What would be a minimum Apache install and > config to run Django locally (on Windows)? try nginx+fcgi/tornado/your favourite webserver --

html in django password_reset_email.html

2010-11-02 Thread andy
I recently tried to send the following in a test password email from a site I am creating: This is a test reset password email. However when I received the email it displayed the "This is a test reset password email.". My question is how can I send a styled email using html tags and possibly

Re: 2D map application: performance and design question

2010-11-02 Thread Lars Ruoff
Ok, so having excluded SQLite and the static served files, I'd like to test if the server matters. What would be a minimum Apache install and config to run Django locally (on Windows)? On Nov 1, 7:30 pm, Lars Ruoff wrote: > Ok, thanks all, > > So following Bill's advice, i

Re: Mod_Python and everything loaded, Apache serving HTML files without using Django first

2010-11-02 Thread Daniel Roseman
On Nov 1, 9:15 pm, The End wrote: > I've finally got mod_python and mysqldb working with apache (long > story short, can't install wsgi for various reasons and i'm using > python 2.4.3... for various reasons...). > > However > > Now when i load up the home page (just