Re: Ok to load many .js files to support lots of interactive widgets?

2010-01-14 Thread Margie Roginski
Thanks Daniel, I will look into Yahoo YSlow. Is there a particular tool/toolset that you have used/recommend for doing the combining? Margie On Jan 14, 2:37 pm, Daniel Roseman wrote: > On Jan 14, 8:01 pm, Margie Roginski wrote: > > > > > As

following relationships forward in queries

2010-01-14 Thread Michael Thon
I have an Model with a field that is a oneToOne relationship with a model in another app: class SensePost (models.Model): feedjackpost = models.OneToOneField(Post, blank=True, null=True) ... I'm trying to to write a filter query that uses fields in the related model: senseposts =

Re: query related question

2010-01-14 Thread Shawn Milochik
On Jan 14, 2010, at 11:53 PM, E. Hakan Duran wrote: > Thanks a lot for the quick response. > > On Thursday 14 January 2010 23:08:43 Shawn Milochik wrote: > >> ... >> woman = Woman.objects.get(lastname__exact = 'Test') >> couple = Couple.objects.get(couple = woman.couple) >> >> Note that this

Resolver404 exception in Django on Google App Engine?

2010-01-14 Thread Kumar McMillan
Is anyone else getting this on Google App Engine? I have seen it across different versions of Django (1.0 to 1.1.1) but it only happens intermittently. I am using the latest Google App Engine Django code and although I'm not sure it's a bug in their code I submitted an issue here (where you can

Re: query related question

2010-01-14 Thread E. Hakan Duran
Thanks a lot for the quick response. On Thursday 14 January 2010 23:08:43 Shawn Milochik wrote: > ... > woman = Woman.objects.get(lastname__exact = 'Test') > couple = Couple.objects.get(couple = woman.couple) > > Note that this is making the assumption that there is only one woman with > that

Re: Underscores vs. Numbers

2010-01-14 Thread Wiiboy
Well, to solve this, I'm planning to subclass the "get_available_name" method in django.core.files.storage.Storage to do exactly what it does now, except add a number instead of underscores. Any reason not to do this? -- You received this message because you are subscribed to the Google Groups

Re: Querysets returns wrong result when using threading.

2010-01-14 Thread James Bennett
On Thu, Jan 14, 2010 at 10:26 PM, Kieran Brownlees wrote: > Basic example of format: > Main Thread: print objects.all() > Spawned Thread: print objects.all() -- same as main thread > Main Thread: objects.create(newObj) > Main Thread: print.objects.all() -- correct queryset,

Querysets returns wrong result when using threading.

2010-01-14 Thread Kieran Brownlees
Hello All, Using Django 1.1.1. Today I found some very strange behaviour when trying to use theading, from what I understand it is different from the notes on trac of querysets not being thread safe. Basic issue trying to execute queries while in a thread always returns an original query.

Re: query related question

2010-01-14 Thread Kevin Monceaux
E. Hankan, On Thu, Jan 14, 2010 at 10:53:31PM -0500, E. Hakan Duran wrote: Take the following with a grain, or three, of salt. I'm a little rusty. I converted a web site to Django back in the pre-1.x days and am just getting back to tinkering with Django to enhance the functionality of said

Re: query related question

2010-01-14 Thread Shawn Milochik
Your couple_query returns a queryset. Even if there's only one result, you're not getting just the one woman, but a queryset object. I think you want something more like: woman = Woman.objects.get(lastname__exact = 'Test') couple = Couple.objects.get(couple = woman.couple) Note that this is

query related question

2010-01-14 Thread E. Hakan Duran
Hi all, I don't have a technical background, so please be gentle with me. I have two models with a ForeignKey relation: "couple" and "woman". I am trying to set up a query that lists the women with lastname='Test' along with some of their information from the "woman" model as well as some from

Re: Best way to track user presence

2010-01-14 Thread Shawn Milochik
Use the built-in session timeout. Probably a good idea in any case, to protect your data and user privacy. If they don't log out, they time out. If you trust your users to have scripting enabled, you can even put a JavaScript function on a timer to sent the browser to your logout URL.

Re: Best way to track user presence

2010-01-14 Thread Brian Neal
On Jan 14, 7:30 pm, E17 wrote: > Hi, > > in my Django application I need a way to track logged users presence. > > User gets an 'online' status when he/she logs in and 'offline' status > when logs out, it's pretty simple. But what is the best way to handle >

Best way to track user presence

2010-01-14 Thread E17
Hi, in my Django application I need a way to track logged users presence. User gets an 'online' status when he/she logs in and 'offline' status when logs out, it's pretty simple. But what is the best way to handle non-logged-out sessions? One need to periodically check all sessions on last

Problem with ManyToMany Relationship and related_name

2010-01-14 Thread HWM-Rocker
Hi, I am relatively new with Django but I like what I have seen so far. why does this not work? class Tag(models.Model): text = models.CharField(max_length=200) children = models.ManyToManyField('self', blank=True, null=True, symmetrical=True, related_name='parents') synonyms =

Problem when trying to validate a field in a ModelAdmin which has inline forms

2010-01-14 Thread Gabriel Reis
Hi people, I am having some problem to validate a data in my application. I will try to simply the model in here to help you guys to understand the problem. I have 2 models: class Clip(models.Model): is_approved = models.BooleanField(default=False) language = models.ForeignKey(Language)

Re: Ok to load many .js files to support lots of interactive widgets?

2010-01-14 Thread Daniel Roseman
On Jan 14, 8:01 pm, Margie Roginski wrote: > As I've learned more about jquery/javascript, I've added more and more > jquery interactive widgets to my app (which is sort of like a ticket > tracking app).  I'm wondering if having too many .js files is a bad > thing (or a

How to pass raw sql results (cursor.fetchall()) to the template?

2010-01-14 Thread Ken
Newb question here. How do I pass raw sql results to my template? The sql results contains a two column queryset with several rows . Below doesn't work. How do I make this work? Do I need to parse the results into an array and then pass to the template? IN THE VIEW: cursor =

Re: Insert AUTOMATICALLY random string in username field

2010-01-14 Thread Eric Chamberlain
On Jan 14, 2010, at 6:45 AM, nameless wrote: > > > I want username field is automatically filled with this value: > > username = str(n); > > where n is a number of 10 digits ( autoincremented or random ). > > . > > I tried to add this in save method: > > username =

Re: Text Search using Python

2010-01-14 Thread Gabriel Falcão
There is a Django abstraction to whoosh: http://haystacksearch.org/ On Thu, Jan 14, 2010 at 12:36 PM, Mark (Nosrednakram) wrote: > Hello, > > I've been using whoosh and find it very easy to implement.  Whoosh has > good documentation on static file indexing and  django

Ok to load many .js files to support lots of interactive widgets?

2010-01-14 Thread Margie Roginski
As I've learned more about jquery/javascript, I've added more and more jquery interactive widgets to my app (which is sort of like a ticket tracking app). I'm wondering if having too many .js files is a bad thing (or a good thing)? Here's an example to make my question more understandable. I

inline formset

2010-01-14 Thread Frédéric Burlet
Hi, I'm a bit stuck with inline formset. I missed something. I'm using django 1.1.1. I have a model: class Address(models.Model): street = ... number = ... ... class Person(models.Model): first_name = ... last_name = address = models.ForeignKey(Address) ... Based

Re: Filter on forms.ModelChoiceField(queryset=Image.objects.filter())

2010-01-14 Thread Tom Evans
On Thu, Jan 14, 2010 at 6:39 PM, GoSantoni wrote: > Hi > > Is it possible to use extra filter on a ModelChoiceField? > > Tried several strategies: > > if photo.member == user: >    url = forms.ModelChoiceField(queryset=Image.objects.filter()) > > or >    url =

Re: Insert AUTOMATICALLY random string in username field

2010-01-14 Thread Tom Evans
On Thu, Jan 14, 2010 at 6:34 PM, nameless wrote: > uuid is too long for username field ( max 30 characters ). "n" should > be a number of 10 digits :) > > Er, a UUID is a 128 bit number. In its standard 'for humans' format it is represented as 36 character hexadecimal

Re: Filter on forms.ModelChoiceField(queryset=Image.objects.filter())

2010-01-14 Thread Daniel Roseman
On Jan 14, 6:39 pm, GoSantoni wrote: > Hi > > Is it possible to use extra filter on a ModelChoiceField? > > Tried several strategies: > > if photo.member == user: >     url = forms.ModelChoiceField(queryset=Image.objects.filter()) > > or >     url =

permalinks from cron job

2010-01-14 Thread eric.frederich
My django urls work nicely when browsing around, clicking things, and when my views generate emails. They all have the appropriate prefix. In apache's conf file I have the following... WSGIScriptAlias /apps /export/home/web/docs/django/my_site/apache/ django.wsgi My urls look like

import error on dateutil.parser

2010-01-14 Thread newspaper-django-lackey
I'm attempting to use python-dateutil to parse the date output from Feedparser, but continue to get an error when importing the parser. I'm building a quick filter in a timeutil.py file in a templatetag folder on the pythonpath from dateutil.parser import parse def parsefeedtime(value):

Re: Text Search using Python

2010-01-14 Thread esatterwh...@wi.rr.com
I've been working on 2 sites that use full text search on a wiki-like system where users use a WYSIWYG/html editor. This, obviously, doesn't apply to flatpages, but the poblem/solution might be of help. The problem is, if you try tindex/search html, you get a lot terrible results. For example, if

Re: Insert AUTOMATICALLY random string in username field

2010-01-14 Thread Tom Evans
On Thu, Jan 14, 2010 at 2:45 PM, nameless wrote: > > > I want username field is automatically filled with this value: > > username = str(n); > > where n is a number of 10 digits ( autoincremented or random ). > > . > > I tried to add this in save method: > > username =

Documentation for graphic designers

2010-01-14 Thread Zee
I'd like to know if there is manual or "How to Guide" for graphic designers working with django. -- 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,

Re: Django Cache

2010-01-14 Thread Hinnack
why dont you use localurl http://code.google.com/p/django-localeurl/ so you have the language automatically in the URL and you do not need to change anything... -- Hinnack 2010/1/14 vitor torres > Hi. I'm building blog and I want to cache the main page wich is a >

Re: Insert AUTOMATICALLY random string in username field

2010-01-14 Thread Shawn Milochik
Do a Google search on 'mysql' and 'sequences.' Also, have a look at MySQL's last_insert_id() function. Maybe that's all you need to use an autonumber as a sequence. Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Insert AUTOMATICALLY random string in username field

2010-01-14 Thread nameless
Sequences are best solution for me but I don't know how to implement its in django+mysql. I tought also to use id as username but I don't know how do this :-\ Could you explain me how do pleaseee ? Thank you --- On Jan 14, 4:16 pm, Shawn Milochik wrote: >

Django Cache

2010-01-14 Thread vitor torres
Hi. I'm building blog and I want to cache the main page wich is a archive_index generic view and I want to be able to choose between languages wich means that I must do different cache depending on the language. So I tried to use the the decorator @vary_on_headers('Accept- language') in my urls.py

Re: decimal is not json serializable.

2010-01-14 Thread Simon Brunning
2010/1/14 Meenu : > Hello all, > > I'm following the "Serializing Django objects" documentation and have > a view pretty much verbatim from the docs: > >        if xhr: >            return HttpResponse(simplejson.dumps(form_data), > mimetype='application/javascript') >

Underscores vs. Numbers

2010-01-14 Thread Wiiboy
I noticed when I upload multiple files to my website with the same name, Django adds underscores to the file names. But doesn't that seems like it's less efficient than adding numbers to the end, (i.e. myfile (1).txt)? And on some OSs, a file name can be too long, which could cause problems.

Two Email Backends

2010-01-14 Thread Thomas Guettler
Hi, we code intranet applications which run in the internal net of the customers. I would like to have two email connections: 1. smtp host of customer 2. machine local smtp for exception emails Up to now I use the settings file for the machine local smtp and create a own connection if my

Re: Insert AUTOMATICALLY random string in username field

2010-01-14 Thread Shawn Milochik
There are a bunch of ways you can do it. As a previous poster said, you can take 10 digits of the current timestamp. However, be wary of daylight saving time changes (if you have them on your server), and the possibility of any conflict if you change servers, have a backup server, or ever

Re: decimal is not json serializable.

2010-01-14 Thread Shawn Milochik
You could always convert decimals to strings. There's probably a better solution out there, but this should at least be a quick-fix. Shawn-- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: A question about database models

2010-01-14 Thread Jani Tiainen
On Thu, 2010-01-14 at 03:25 -0800, ifcho wrote: > Hi, > > I'm very new to Django, and I'm sorry if the question is really dumb. Kind of a dumb question... See why: > So I have a database model for a drivers (rally car driver), and I > have database model for the results. As you know a rally car

Re: Insert AUTOMATICALLY random string in username field

2010-01-14 Thread Stephen Emslie
How about a timestamp? import time name = str(time.time()) On Thu, Jan 14, 2010 at 2:45 PM, nameless wrote: > > > I want username field is automatically filled with this value: > > username = str(n); > > where n is a number of 10 digits ( autoincremented or random ).

Insert AUTOMATICALLY random string in username field

2010-01-14 Thread nameless
I want username field is automatically filled with this value: username = str(n); where n is a number of 10 digits ( autoincremented or random ). . I tried to add this in save method: username = str(random.randint(10,99)) but there is a collision problem when n is the same

Re: A question about database models

2010-01-14 Thread Tom Evans
On Thu, Jan 14, 2010 at 11:25 AM, ifcho wrote: > Hi, > > I'm very new to Django, and I'm sorry if the question is really dumb. > > So I have a database model for a drivers (rally car driver), and I > have database model for the results. As you know a rally car team is > of two -

A question about database models

2010-01-14 Thread ifcho
Hi, I'm very new to Django, and I'm sorry if the question is really dumb. So I have a database model for a drivers (rally car driver), and I have database model for the results. As you know a rally car team is of two - a driver and co-driver. And so I have: class EntryList(models.Model): .

Can't connect to MySQL server

2010-01-14 Thread Hans.Rauch
Hi, we have two separate django- and mysql-servers. Most of the time we got no problems. From time to time we get an email with the following error-message: OperationalError: (2003, "Can't connect to MySQL server on '..' (4)"). If we call the submitted link, where the error occured, we don't have

decimal is not json serializable.

2010-01-14 Thread Meenu
Hello all, I'm following the "Serializing Django objects" documentation and have a view pretty much verbatim from the docs: if xhr: return HttpResponse(simplejson.dumps(form_data), mimetype='application/javascript') When I test the above view using the Django shell, it

Re: Text Search using Python

2010-01-14 Thread Mark (Nosrednakram)
Hello, I've been using whoosh and find it very easy to implement. Whoosh has good documentation on static file indexing and django related documentation is available. Whoosh Specific http://whoosh.ca/ http://files.whoosh.ca/whoosh/docs/latest/index.html Django Related

Re: Send and Receive SMS from a django app

2010-01-14 Thread Alessandro Ronchi
On Thu, Jan 14, 2010 at 12:26 PM, Daniel Hilton wrote: > > You'll need a GSM modem though. > Perfect! Are all RSR232 GSM modems compatible with pygsm, or everyone needs a proprietary or different library to be used? -- Alessandro Ronchi http://www.soasi.com SOASI -

Re: Test fixtures loaded ~100 times faster by overwriting BaseDatabaseCreation.create_test_db + question

2010-01-14 Thread Russell Keith-Magee
On Thu, Jan 14, 2010 at 4:43 PM, Piotr Czachur wrote: > Guys, > I was really unhappy to see how slow fixtures are loaded before every > test. I'm not talking about initial_data stuff that is loaded just in > beginning, and then reset by rollback. Fixtures used for unit tests >

Re: Text Search using Python

2010-01-14 Thread Shawn Milochik
On Jan 14, 2010, at 6:04 AM, Amit Sethi wrote: > Hi , I have a project with a few static html pages , I wish to search these > static html using a django search app . Most of the tutorials I saw are > focused on searching django models but none I could see concentrates on > indexing static

Re: Send and Receive SMS from a django app

2010-01-14 Thread Daniel Hilton
2010/1/14 Alessandro Ronchi : > > > On Wed, Jan 13, 2010 at 2:29 PM, tback wrote: >> >> Hi Alessandro, >> >> yes, it's possible to send sms messages (I use this myself every day) >> and to receive sms messages (that's an assumption). >> The easiest way

Text Search using Python

2010-01-14 Thread Amit Sethi
Hi , I have a project with a few static html pages , I wish to search these static html using a django search app . Most of the tutorials I saw are focused on searching django models but none I could see concentrates on indexing static html pages . Can some one guide be to a library /tutorial etc

Re: Send and Receive SMS from a django app

2010-01-14 Thread Alessandro Ronchi
On Wed, Jan 13, 2010 at 2:29 PM, tback wrote: > Hi Alessandro, > > yes, it's possible to send sms messages (I use this myself every day) > and to receive sms messages (that's an assumption). > The easiest way is through a sms gateway. > http://www.celltrust.com/ is a provider

Re: Only Email + Password ( without username )

2010-01-14 Thread nameless
I want to use "id" as identifier for each user. So every user will have an url like this: http://www.example.com/827362 I don't want username for my project. So, if I can't delete it, I think to insert email in username field and I don't want another identifier in username field as random

Re: Only Email + Password ( without username )

2010-01-14 Thread Alexander Dutton
On 14/01/10 09:51, nameless wrote: > I am asking whether is a good solution to having 2 fields with the > same value ( username and email ) because both are required. > Or is there another solution ? > This depends on whether you don't want distinct usernames hanging around, or you simply want

Re: Only Email + Password ( without username )

2010-01-14 Thread nameless
I am asking whether is a good solution to having 2 fields with the same value ( username and email ) because both are required. Or is there another solution ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Only Email + Password ( without username )

2010-01-14 Thread nameless
I want a Registration Form with only email + password. I am thinking to insert automatically email in username field. So, for eash user, I will have this: username: exam...@example.com password: mypassword email: exam...@example.com Of course email + password will be used in login process.

Re: again a group by problem...

2010-01-14 Thread Benjamin Wolf
Hi Russ, thank you so much for your answer - it works fine, and it's really easy. I really have to think different next time ;) Greets, ben Am 14.01.2010 01:05, schrieb Russell Keith-Magee: On Thu, Jan 14, 2010 at 7:56 AM, Bw. wrote: Hi guys, I'm trying to realize a

Test fixtures loaded ~100 times faster by overwriting BaseDatabaseCreation.create_test_db + question

2010-01-14 Thread Piotr Czachur
Guys, I was really unhappy to see how slow fixtures are loaded before every test. I'm not talking about initial_data stuff that is loaded just in beginning, and then reset by rollback. Fixtures used for unit tests are loaded on demand (fixtures = [f1, f2]), and this is really slow, because