Re: offtopic: delete *.pyc from subversion

2006-11-29 Thread Fredrik Lundh
Kenneth Gonsalves wrote: >> when I do "svn diff" the pyc-files are still listed. >> guess I have to delete that files from the repository first. right? > > svn remove will delete the files on the next commit adding things to global-ignores does *not* affect files that are already checked in.

Re: Suggestion: Aggregate/Grouping/Calculated methods in Django ORM

2006-11-29 Thread Russell Keith-Magee
On 11/30/06, Rob Hudson <[EMAIL PROTECTED]> wrote: > > > I think for those who need aggregate data these would cover a lot of > ground. I'd be willing to work on a patch if this is considered > generally useful and we can work out what the API should look like. > > 1 - I'm agreed on the need for

RE: utf-8 with MySQL

2006-11-29 Thread Ryan Ginstrom
> On Behalf Of Aidas Bendoraitis > I guess, this query may help you: > ALTER DATABASE `yourdatabase` DEFAULT CHARACTER SET utf8 > COLLATE utf8_general_ci So that's how to do it. Thanks! Regards, Ryan Ginstrom --~--~-~--~~~---~--~~ You received this message

Populating select field in custom manipulator

2006-11-29 Thread jeffhg58
I am trying to use a customer manipulator to build a search screen. One of my fields is a select field but I get an error to many values to unpack. Any help would be greatly appreciated. views.py class SearchResults(forms.Manipulator): def __init__(self): projects = ['Gen2',

Database question

2006-11-29 Thread Eric Lake
I am working on a church site that will have multiple areas. There will be pages for each of the different ministries like music, singles, students, etc. I am wanting a blog like function for each of these pages where the responsible people will be able to log in to the admin site and add news to

Database question

2006-11-29 Thread Eric Lake
I am working on a church site that will have multiple areas. There will be pages for each of the different ministries like music, singles, students, etc. I am wanting a blog like function for each of these pages where the responsible people will be able to log in to the admin site and add news to

Re: accumulating a query filter

2006-11-29 Thread Kenneth Gonsalves
On 30-Nov-06, at 1:04 AM, James Bennett wrote: > I leave off * and ** by accident all the time. That and commas in > single-element tuples are probably 90% of the stupid Python mistakes I > make. add leaving out '()' in a function without arguments and you are done -- regards kg

Re: offtopic: delete *.pyc from subversion

2006-11-29 Thread Kenneth Gonsalves
On 30-Nov-06, at 12:19 AM, patrick k. wrote: > hmm, that doesn´t really change anything. > > when I do "svn diff" the pyc-files are still listed. > guess I have to delete that files from the repository first. right? svn remove will delete the files on the next commit -- regards kg

Re: Suggestion: Aggregate/Grouping/Calculated methods in Django ORM

2006-11-29 Thread Rock
On Nov 29, 2:30 pm, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > > I needed aggregates. (I also learned about data bubbles and redesigned > > my tables to include them as necessary. This redesign eliminated almost > > all of my needs for an aggregate function interface.)Whatsa data bubble? > >

How to preload all object fields for a QuerySet? (GenericForeignKey and select_related())

2006-11-29 Thread Ed
Hello, is there a way to force the django db model to load all fields for a particular model _including_ any generic foreign keys (it doesn't seem to do this by default). Currently: Account.objects.select_related() will load all 'simple' fields like IntegerField, CharField, etc, but not

django model question about FileField

2006-11-29 Thread gregor
Hi all I ve got situation like this, I 'm writing a photograph's gallery where photo should be stored on disk in folders like this \\\ At the moment of creation Photo object I know album that foto belongs to and I know the photographer but I can't to implement path to upload_to option. How to do

Re: How to get request.user in templatetag?

2006-11-29 Thread Rudolph
Sorry, that was a stupid question, context['request'].session contains the session. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: offtopic: delete *.pyc from subversion

2006-11-29 Thread Fredrik Lundh
Rob Hudson wrote: > Yes, I guess I should have said "And tell subversion to ignore them." if you read the original message again, you'll notice that the OP had already done that. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Add 8 hours from datetime before storing in db?

2006-11-29 Thread James Bennett
On 11/29/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > How could I alter this so that it adds 8 hours onto the datetime before > storing it in the db? datetime.timedelta. Sample code: >>> import datetime >>> dt = datetime.datetime.now() >>> dt datetime.datetime(2006, 11, 29, 16, 7, 49,

Re: How to get request.user in templatetag?

2006-11-29 Thread Rudolph
But how do you access the session dictionary from a templatetag? --~--~-~--~~~---~--~~ 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

using manipulators without defining fields again

2006-11-29 Thread Milan Andric
I'm writing an application form, an application for a workshop. User registration is required and people can start and continue the application process, essential create and edit their application data until the deadline is reached. The form is just one part of a web site, and it has 70 or so

Apache auto-reload?

2006-11-29 Thread David Abrahams
Hi, I'm developing a site locally, and managing its code and static data in a subversion repository. I also have it running on a real apache server on the web with mod_python, but I don't want to login to the server, restart, etc. every time I check something in. I've got a post-commit hook

Re: manage.py can't see project

2006-11-29 Thread Joshua \"jag\" Ginsberg
I'd start with "manage.py shell" and "import sys; print sys.path" to look for anything unusual. -jag On Tue, 2006-11-28 at 21:19 +, [EMAIL PROTECTED] wrote: > Yup... like I said, the models and templates and all appear to see it > no problem. It's looks like it's just manage.py that's not

Re: offtopic: delete *.pyc from subversion

2006-11-29 Thread Rob Hudson
patrick k. wrote: > when I do "svn diff" the pyc-files are still listed. > guess I have to delete that files from the repository first. right? Yes, I guess I should have said "And tell subversion to ignore them." Once you set Subversion to ignore *.pyc, they won't be added anymore. But if you

Re: Updating and saving a related record. How does it work?

2006-11-29 Thread MerMer
I am finding that the following intermediate step is required. Comp=Promo.competition This changes the class from Promotion to Competition and I can then make the changes Comp.total_value=3000 Comp.save() However, I'm no wiser why the earlier solution by Jacob is not working for me.

Re: manage.py can't see project

2006-11-29 Thread [EMAIL PROTECTED]
Anyone? I'm wondering if it's a pythonpath issue, but don't really know how to check (or fix). I found one thread that suggested adding the project to sys.path within manage.py, but that didn't help. --~--~-~--~~~---~--~~ You received this message because you

Re: Re: accumulating a query filter

2006-11-29 Thread James Bennett
On 11/29/06, Bill de hOra <[EMAIL PROTECTED]> wrote: > I was passing it in without the **; arrhhh :) I leave off * and ** by accident all the time. That and commas in single-element tuples are probably 90% of the stupid Python mistakes I make. -- "May the forces of evil become

Re: Retrieve Password

2006-11-29 Thread Don Arbow
On Nov 29, 2006, at 10:50 AM, Clint74 wrote: > > Hi, > > I need to send the password to the user(email), but how recover the > raw > password once the database stores in this format: > > hashType$salt$hash > sha1$6070e$d3a0c5d565deb4318ed607be9706a98535ec7968 You cannot recover the password

Re: accumulating a query filter

2006-11-29 Thread Bill de hOra
James Bennett wrote: > Doing NodeEvent.objects.filter(**kwargs) should work ^^ I was passing it in without the **; arrhhh anyway this the idiom I ended up with for a different model: [[[ if request.has_key('q'): # GET form new_data =

Re: Retrieve Password

2006-11-29 Thread Clint74
> One generally has a facility to reset the password by > ... > The user can then log in with the new password, > and be directed to change it to a known password. I will try this approach. Thanks everybody --~--~-~--~~~---~--~~ You received this message

Re: Retrieve Password

2006-11-29 Thread Clint74
Thank´s Jacob, I missed something indeed. Regards --~--~-~--~~~---~--~~ 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

Re: Retrieve Password

2006-11-29 Thread Jeremy Dunck
On 11/29/06, Clint74 <[EMAIL PROTECTED]> wrote: > I need to send the password to the user(email), but how recover the raw > password once the database stores in this format: > > hashType$salt$hash > sha1$6070e$d3a0c5d565deb4318ed607be9706a98535ec7968 You can't, and that's the point of storing a

Re: Retrieve Password

2006-11-29 Thread Jacob Kaplan-Moss
On 11/29/06 12:50 PM, Clint74 wrote: > I need to send the password to the user(email), but how recover the raw > password once the database stores in this format: You can't; that's the point of hashing it. The right (read: secure) way to deal with this is to *reset* the user's password

Re: Suggestion: Aggregate/Grouping/Calculated methods in Django ORM

2006-11-29 Thread Rock
I created such a patch last spring during the Django sprint at PyCon. The basic interface was very straightforward but there was also a slightly less straightforward interface option that allowed for grouping and so forth. The patch was discarded, however, since some of the core Django

Re: Retrieve Password

2006-11-29 Thread Tim Chase
> I need to send the password to the user(email), but how recover the raw > password once the database stores in this format: > > hashType$salt$hash > sha1$6070e$d3a0c5d565deb4318ed607be9706a98535ec7968 Hashing is generally a one-way process (like making hamburger out of cow) that prevents

Re: offtopic: delete *.pyc from subversion

2006-11-29 Thread patrick k.
hmm, that doesn´t really change anything. when I do "svn diff" the pyc-files are still listed. guess I have to delete that files from the repository first. right? thanks, patrick Am 29.11.2006 um 18:42 schrieb Rob Hudson: > > Or tell Subversion to ignore them. > > You should have a file:

Re: Retrieve Password

2006-11-29 Thread patrick k.
not possible, I think. solutions: 1. send the password before you save the user 2. store the raw password somewhere (not so good) patrick Am 29.11.2006 um 19:50 schrieb Clint74: > > Hi, > > I need to send the password to the user(email), but how recover the > raw > password once the

Re: Updating and saving a related record. How does it work?

2006-11-29 Thread MerMer
Jacob, I had tried that, but it's not working for me.I get the following:- Promo=Promotion.objects.get(id=1) Promo.competition.total_value >> 2000 Promo.competition.total_value=3000 Promo.competition.save() Promo.competition.total_value >> 2000 I must be doing something stupid, but can't

Retrieve Password

2006-11-29 Thread Clint74
Hi, I need to send the password to the user(email), but how recover the raw password once the database stores in this format: hashType$salt$hash sha1$6070e$d3a0c5d565deb4318ed607be9706a98535ec7968 Tk´s André Duarte --~--~-~--~~~---~--~~ You received this

Re: accumulating a query filter

2006-11-29 Thread nymbyl
I don't know if this helps, or is exactly what your trying to avoid, but I've done something like this before (based on your example): if use_sources: qSource = Q(source_time__range=(start_date, end_date)) else: qSource = Q(id__gt=0) if use_level: qLevel = Q(level__exact=level) else:

Re: Updating and saving a related record. How does it work?

2006-11-29 Thread Jacob Kaplan-Moss
On 11/29/06 11:31 AM, MerMer wrote: > However, I can't work out how to save a different value to the field > using something like > > Promotion.competition.total_value=3000 Promotion.competition.save() Jacob --~--~-~--~~~---~--~~ You received this message

django model question for small library

2006-11-29 Thread Grigory Fateyev
Hello! I am writing small app for online library with full text seach. I have all books (less than 25) in html files for every chapter with only and tags, filenames look like book1-4.html and so on. Can somebody suggeest how models.py should looks? Should I insert chapters to database or keep

Re: offtopic: delete *.pyc from subversion

2006-11-29 Thread Rob Hudson
Or tell Subversion to ignore them. You should have a file: ~/.subversion/config (on Mac or Linux, not sure where it is on Windows) In that file under the header "[miscellany]" there's a "global-ignores" setting. Just add *.pyc to that list. -Rob

Updating and saving a related record. How does it work?

2006-11-29 Thread MerMer
I was able to save a record like so... Promotion.total_value=2000 Promotion.save() However, I recently moveed the "total_value" field into another model which has a OneToOne relationship with the Promotion Model. Know I can access total_value like so:- Promotion.competition.total_value >>

Re: Re: manage.py webserver

2006-11-29 Thread James Bennett
On 11/29/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > After much googling, I found that if there is no data in the tables, it > produces a 404 error. That's not quite correct; if there's nothing which matches the conditions of the QuerySet you pass to the generic view, and if the

Re: accumulating a query filter

2006-11-29 Thread James Bennett
On 11/29/06, Bill de hOra <[EMAIL PROTECTED]> wrote: > something like this: > > [[[ > if use_sources: >kwargs['sources']= request.GET.getlist('sources') > if use_level: >kwargs['level'] =request.GET['level'] > ... > results = NodeEvent.objects.filter(kwargs) > ]]] Doing

accumulating a query filter

2006-11-29 Thread Bill de hOra
Hi, Suppose you have 2 fields in a query form, both of which are optional. Is there an idiom for building a dictionary to pass into objects.filter() instead of checking the permutations? eg instead of crazy stuff like this: [[[ if use_sources and use_level: results =

Re: offtopic: delete *.pyc from subversion

2006-11-29 Thread va:patrick.kranzlmueller
thanks. Am 29.11.2006 um 17:51 schrieb Marcin Jurczuk: > > find . -name '*pyc' |xargs svn delete > to delete them: > find . -name '*pyc"|xargs rm -f > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Suggestion: Aggregate/Grouping/Calculated methods in Django ORM

2006-11-29 Thread Rob Hudson
In another thread I wrote the following in regards to how to get the average for a field: > Could we educate ourselves on how other frameworks are solving this same > problem and maybe that will lead us to a solution? A quick look at ActiveRecord brings up ActiveRecord::Calculations:

offtopic: delete *.pyc from subversion

2006-11-29 Thread va:patrick.kranzlmueller
in my svn-repository, I´m having *.pyc-files. question is: how do I get rid of these files? global-ignores is set to *.pyc now (after initial import and some changes). do I have to manually delete the pyc-files? since my svn-repos is django-related I dare to ask. thanks, patrick

Re: Opera & caching

2006-11-29 Thread Michal
> Yep, you want to use the Cache-Control HTTP directive [1]. More > specifically, you probably want to set `no_cache=True` to force > browsers to never cache that page. > > [1]: > http://www.djangoproject.com/documentation/cache/#controlling-cache-using-other-headers > Thank you for your

Re: offtopic: delete *.pyc from subversion

2006-11-29 Thread Marcin Jurczuk
find . -name '*pyc' |xargs svn delete to delete them: find . -name '*pyc"|xargs rm -f --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: manage.py webserver

2006-11-29 Thread [EMAIL PROTECTED]
After much googling, I found that if there is no data in the tables, it produces a 404 error. I added some data, and sure enough, everything worked fine. So, that was my problem with that. :-( As for other problems, I agree, there is a lot of info that is displayed...but I guess I just don't

Help with admin views

2006-11-29 Thread Jim Fritchman
I am hoping some of you can give me a little start as to where I can read how to alter some of the admin pages. I have a a Person class in my model and I want to change both the view of people plus I want to change the form page where people are added and deleted. Any links or examples or

Initial data for models splitted across multiple files

2006-11-29 Thread Mikko Suniala
Greetings, I did a quick search but found nothing about this issue. I have splitted my models across multiple files as described in http://code.djangoproject.com/wiki/CookBookSplitModelsToFiles. The manager action "sqlinitialdata" did not seem to find my sql files. After some investigation I

Re: best place to put dispatcher.connect code?

2006-11-29 Thread Nathan R. Yergler
I don't think manage.py does much with the path, since the INSTALLED_APPS are given in Python package path syntax, and therefore must be resolvable on the PYTHONPATH (ie, no additional information is given for paths). The only thing I've noticed that it may twiddle is adding the directory

Re: Opera & caching

2006-11-29 Thread Waylan Limberg
On 11/29/06, Michal <[EMAIL PROTECTED]> wrote: > > Hello, > I have problems with Opera browser and caching. > > I have URL /prihlaseni/. > If user isn't logged, I give him html form for login. > If user is already logged, I give him only text message, that inform him > about this state, together

Re: best place to put dispatcher.connect code?

2006-11-29 Thread Le Roux Bodenstein
I actually just tried that, but I'm getting import errors. Probably because I am importing from myapp.something.module.. Putting code in settings.py just seems dodgy. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: best place to put dispatcher.connect code?

2006-11-29 Thread Le Roux Bodenstein
Actually, no. That didn't really work. Now manage.py seems even more confused. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: best place to put dispatcher.connect code?

2006-11-29 Thread Le Roux Bodenstein
Aah. It is because of this chicken and egg scenario.. manage.py adds your project's dir to the path after it imports your settings module. So when the settings module is being imported your project is not in the path yet, so you cannot import from myproject.some_package.some_module.. I now added

Re: best place to put dispatcher.connect code?

2006-11-29 Thread Ivan Sagalaev
Le Roux Bodenstein wrote: > Surely if I put it > in a model or a view or whatever somewhere it will only be called the > first time that module gets loaded? The settings module is always imported so you can import your handling code there and put dispatch.connect beside the handling code.

best place to put dispatcher.connect code?

2006-11-29 Thread Le Roux Bodenstein
Hi I want to implement some custom caching stuff, so I want to capture _all_ post_save signals. Where is the best place to call dispatcher.connect? Surely if I put it in a model or a view or whatever somewhere it will only be called the first time that module gets loaded? Basically I'm asking

Re: Strange Proxy error

2006-11-29 Thread [EMAIL PROTECTED]
Turns out it WASN'T the state field... it was the fact that once the state was present, my geolocating script kicked in on page load and tried to get a geocode for the address. That makes a lot more sense. --~--~-~--~~~---~--~~ You received this message

Re: Session data remains after logout

2006-11-29 Thread django-user
Thanks Antonio. This does not directly solve my problem (linked to an old PHP reflex by the way), but I'll definitely have a look as it may come in handy later. I see no 'magic' answer to my problem, and looking at the function django.contrib.auth.logout(), it's not that hard to wrap around it.

Re: ManyRelatedManager object in templates

2006-11-29 Thread conrad22
ie what is the simplest way to call the categories that have been selected for each organisation ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: ManyRelatedManager object in templates

2006-11-29 Thread conrad22
Ah ha! I've had a thought..could I use a custom Manager to predefine the query and then call in the template? In which case, how would a write a query set for the manager that only returns those categories that an organisation has selected? --~--~-~--~~~---~--~~

Re: Opera & caching

2006-11-29 Thread Julio Nobrega
Opera's cache is very agressive. I use Opera for almost all of my internet browsing and I've never met a form that isn't shown again (with its field's content intact!) when "backing", either pressing the arrow or using mouse gestures, even when caching is completely disabled (in preferences,

Re: Help with getting connection.queries info

2006-11-29 Thread Tom Smith
I have a similar solution/problem... Firstly, my "solution" was to create a method in my vews.py like this... def my_render(request, template, dict): url_time = 0 try: for query in connection.queries: log( query['time'] + "\t" +

Templates and virtual hosts

2006-11-29 Thread [EMAIL PROTECTED]
I have a problem I can't talk in a huge ammount of details about. I have a template for my index page, I know the path is valid, but I get a Using loader django.template.loaders.filesystem.load_template_source (file does not exist). The permissions are giving group access to www and full

Re: manage.py webserver

2006-11-29 Thread [EMAIL PROTECTED]
very good info thank you. I knew i had seen it i just couldn't remember where. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: manage.py webserver

2006-11-29 Thread Guillermo Fernandez Castellanos
Hi, > > I suspect you hit one small Django controversy. The generic view > > object_list would give you 404 error when the list it tries to show is > > empty. The view is there, it works, finds the list -- all is Ok. It just > > has this strange behavior by default. To overcome it you can add >

Opera & caching

2006-11-29 Thread Michal
Hello, I have problems with Opera browser and caching. I have URL /prihlaseni/. If user isn't logged, I give him html form for login. If user is already logged, I give him only text message, that inform him about this state, together with link to logout. So, one URL, but two different content