Re: GeoDjango Distances

2007-11-22 Thread Samuel Adam
I don't have answers for you but as you're working with geo data, you might find this library useful: http://exogen.case.edu/projects/geopy/ On Nov 22, 7:15 am, Dan <[EMAIL PROTECTED]> wrote: > Hi > > I started using the Geodjango branch, it seems to be working really > well so far, I have a few

Re: using "select_related" .Does it works?

2007-11-20 Thread Samuel Adam
The purpose of select_related() is to limit the number of connections to the database server. An analogy would be that if you have a webpage with 4 CSS file inclusions ( >> from pm.models import Message >>> from django.db import connection >>> message = Message.objects.get(pk=1) >>> '%s sent a me

Re: How to handle differing timezones?

2007-11-18 Thread Samuel Adam
Heres my take: - Handle every time related data in UTC - Record the user TZ in the UserProfile - Display the user time with a |tz:user template filter I don't have snippets right here but i think Jonathan Buchanan has a clean and similar solution on his forum app: http://www.jonathanbuchanan.plu

Re: Accessing request.user inside a model methods

2007-11-17 Thread Samuel Adam
http://lucumr.pocoo.org/blogarchive/why-i-cant-stand-threadlocal-and-others On Nov 17, 10:20 am, DanB <[EMAIL PROTECTED]> wrote: > Thxs Alex, > > really helpful info. > > Cheers, > DanB > > On Nov 16, 7:04 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote: > > >http://code.djangoproject.com/wiki/CookBo

Re: design Q: where to put peoples names

2007-11-16 Thread Samuel Adam
Want more info ? Create a profile model and tie it to the user in settings.py: AUTH_PROFILE_MODULE = 'profile.UserProfile' Then you can use user.get_profile().phone_number for example. http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-model/ When i started using Django i made

Re: Custom methods for ManyToManyManager

2007-11-16 Thread Samuel Adam
I've been hacking some filtering for related managers, have a look at the BoxManager here: http://django-pm.googlecode.com/svn/trunk/myproject/pm/models.py My app misses the user.inbox.new() feature, i will add it soon. :) On Nov 16, 2:18 pm, "Tomi Pieviläinen" <[EMAIL PROTECTED]> wrote: > Hi gr

Re: Custom methods for ManyToManyManager

2007-11-16 Thread Samuel Adam
I've added it, line 228 On Nov 16, 3:32 pm, Samuel Adam <[EMAIL PROTECTED]> wrote: > I've been hacking some filtering for related managers, have a look at > the BoxManager > here:http://django-pm.googlecode.com/svn/trunk/myproject/pm/models.py > > My app misses

Re: design Q: where to put peoples names

2007-11-16 Thread Samuel Adam
Have the "is_active" field of the User model set to False for the users that don't need a login. The auth login will raise an error if an inactive user tries to log in. Always try to use what is there. On Nov 16, 3:02 pm, Carl Karsten <[EMAIL PROTECTED]> wrote: > The user table has first/last n

Re: Messaging component

2007-11-16 Thread Samuel Adam
I have released my code for a private message system. It's quite powerful, the functions are all displayed in the templates. For example, if you don't want to have message history in the read view, just remove it in the templates. Django is really smart and won't trigger the SQL queries if it do

Re: Query on Instant Messaging

2007-10-24 Thread Samuel Adam
http://www.jabber.org/about/overview.shtml On Oct 24, 10:06 am, Subramanyam <[EMAIL PROTECTED]> wrote: > Hi > > Do we have any libraries in django to provide instant messaging or are > there any open source project that we can integrate it into our web > server (Django-server ) and provide instan

Re: Django rearranges query strings?

2007-10-24 Thread Samuel Adam
It may have something to do with the CommonMiddleware: http://www.djangoproject.com/documentation/middleware/#django-middleware-common-commonmiddleware It doesn't see the trailing slash on your query : /app? and redirects to /app/? Your redirect is strange, it could be a misuse of a regexp in y

Re: Adding extra info to HttpResponseRedirect

2007-10-04 Thread Samuel Adam
HttpResponseRedirect doesn't return a template so you just need to add your message before the redirect: request.user.message_set.create(message="Your playlist was added successfully.") You should implement the display of your messages on your base template like this: {% for message in messages %

Re: media

2007-09-20 Thread Samuel Adam
http://www.djangoproject.com/documentation/static_files/ --~--~-~--~~~---~--~~ 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 t

Re: Arithmetic operations in a templete

2007-09-14 Thread Samuel Adam
no, Scott, you should just do *this*: In your Parrot model, you could add a property that displays your DOM id. class Parrot(models.Model): # fields def _domid(self): return ''parrotButton-%s" % self.id domid = property(_domid) and use parrot.domid in your templates. On 14

Re: django-voting question

2007-09-12 Thread Samuel Adam
Try this : {% for p in posts %} {{ p.0 }} {{ p.1 }} {% endfor %} :P --~--~-~--~~~---~--~~ 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@googlegro

Re: Issue with regroup and sorting with foreign keys

2007-09-11 Thread Samuel Adam
I have had similar issues while sorting with foreignkeys, try specifying the sort like this : {% regroup techskill.name.all|dictsort:"domain.id" by domain as grouped %} On Sep 11, 11:04 am, Nicolas Steinmetz <[EMAIL PROTECTED]> wrote: > Hello, > > Below my model with which I have an issue : > >