Re: Django model version control

2008-10-04 Thread Bas van Oostveen
That is exactly what i did for a project :) When you register a model for versioning, automagicly a new model is created which the original model + an 'version-control' abstract base model to add things like version numbers, datetimestamps, methods to diff between versions etc. Also all unique r

Re: Django Hangman

2008-10-04 Thread Ovnicraft
2008/10/2 chatchai <[EMAIL PROTECTED]> > > Hi all, > > I have built Hangman game using Django. You can see it at > http://feedfrog.net/app/hangman > > If anybody interest in its code, please contact me. > > Enjoy :) > > Chatchai > > > i get it now and review thanks for the contribution, Free as i

Re: Help with login

2008-10-04 Thread KillaBee
On Oct 3, 5:08 am, hcsturix74 <[EMAIL PROTECTED]> wrote: > HI, I've upgraded my site to django 1.0 from 0.96 and  I've installed > "user registration" app from googlecode. > My homepage is a flatpage but I want to insert a login form (just a > form with username and password) > How could I do th

Re: SQL: Migration How To?

2008-10-04 Thread Benjamin Buch
Thanks James and Russel for your replies. Am 04.10.2008 um 07:22 schrieb Russell Keith-Magee: > > On Sat, Oct 4, 2008 at 12:36 PM, Benjamin Buch <[EMAIL PROTECTED]> > wrote: >> >> Is there somewhere a place in the documentation where SQL migration >> strategies are explained a little? >> I thin

Re: Questions about HttpResponseRedirect and reverse

2008-10-04 Thread Malcolm Tredinnick
On Fri, 2008-10-03 at 13:29 -0400, Steve Holden wrote: > Alexis Bellido wrote: > > Cool, thanks for the confirmation. I'm still devouring all the > > documentation, a couple of books and practicing a lot on Django :) > > > One of the things I find tricksiest about learning new Django code is >

Re: Q about a ticket and merging into svn

2008-10-04 Thread Malcolm Tredinnick
On Fri, 2008-10-03 at 19:51 +0800, Russell Keith-Magee wrote: [...] > I wouldn't pin your hopes on the patch making it into trunk. I simply > can't give you any indication of when it will happen. I might happen > next week, it might happen next year. Until it happens, we won't know. > I can tell

Re: python-ldap + Apache causing errors

2008-10-04 Thread Graham Dumpleton
Arrgh, not that issue. Ie., __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALI TY___YOU_MUST_EXEC__() I have seen this before and we got no where in working it out except that some special MacOS X framework and/or function was being used that had some restrictions on it

Re: Mod_python

2008-10-04 Thread Graham Dumpleton
On Oct 4, 2:07 am, djandrow <[EMAIL PROTECTED]> wrote: > I just bought a new laptop and want to install mod_python, is there a > version which is compatible with Python 2.6, I tried the 2.5 version > but it wouldn't let me install that with 2.6. If there isn't a 2.5 > version what would people r

Re: database program

2008-10-04 Thread Tim Chase
> But... The tutorials I've been reading online all recommend > PostgreSQL. I don't care, I'll go that route, but the online server > I am currently using only offers MySQL. Are these two engines > compatible, or am I going to have to go against what the tutorial > advises and intall MySQL on my

Re: SQL: Migration How To?

2008-10-04 Thread James Bennett
On Fri, Oct 3, 2008 at 11:36 PM, Benjamin Buch <[EMAIL PROTECTED]> wrote: > Is there somewhere a place in the documentation where SQL migration > strategies are explained a little? No. For the moment, the only "official", if it can be called that, way to do this is via SQL's ALTER TABLE statement

Re: Django model version control

2008-10-04 Thread David Hall
I did consider such an approach, but this runs into a fair amount confusion for things like model inheritance. Also, it would result in vast quantities of database tables being created. Likewise, custom fields would have to be treated carefully, as would unique fields. Also if you have any M

Re: Django model version control

2008-10-04 Thread David Hall
I've created a Google group for discussing possible improvements to the django-reversion project. The group is called 'django-reversion', and is a good place to let your views be heard about enhancements to the system. At some point I would like to put the project forward as a candidate for t

Access logged in user in models?

2008-10-04 Thread Benjamin Buch
It sounds like a strange question, but I'll ask it... Is it possible to access the currently logged in user in a model? This question is related to the following problem: I have the models 'expense' and 'category' to keep track of my monthly expenses: class Category(models.Model): catego

Re: Access logged in user in models?

2008-10-04 Thread Benjamin Buch
If I would do this in the view, I couldn't do something like this in the template: {% for category in categories %} {% for expense in category.get_monthly_expenses %} ... {% endfor %} {% endfor %} If I do it in the view, the only way I can think of it could be accomplished by stuffing catego

Re: Access logged in user in models?

2008-10-04 Thread Ulises
> If I would do this in the view, I couldn't do something like this in > the template: > > {% for category in categories %} > {% for expense in category.get_monthly_expenses %} > ... > {% endfor %} > {% endfor %} > > If I do it in the view, the only way I can think of it could be > accomplished by

Re: Access logged in user in models?

2008-10-04 Thread Vovk D
2008/10/4, Benjamin Buch <[EMAIL PROTECTED]>: > > > Category1: > expense1: 3.5 > expense2: 3.5 > total: 7.0 > > Category2: > expense1: 2 > expense2: 3 > total: 5 First, i think smth like sum you can do easy with JavaScript on the client-side, if cant do i

Re: Access logged in user in models?

2008-10-04 Thread Benjamin Buch
Am 04.10.2008 um 18:53 schrieb Vovk D: > > > 2008/10/4, Benjamin Buch <[EMAIL PROTECTED]>: > > Category1: > expense1: 3.5 > expense2: 3.5 > total: 7.0 > > Category2: > expense1: 2 > expense2: 3 > total: 5 > > First, i think smth like sum you can do easy w

Re: Access logged in user in models?

2008-10-04 Thread Ulises
> Accessing the user from within the model seems somehow like a bad > idea, but I can't see an other way to do this. How about doing it in a view where you have access to the user object? I reckon this is the type of stuff you normally do in views? U --~--~-~--~~~---

Re: mptt + contrib.comments?

2008-10-04 Thread Jonathan Nelson
I'm actually rolling my own threaded comments system using an MPTT algorithm. Contrib.comments and the django-mptt aren't a really good fit for what I need. It's taken me a while to get my head around the concept of traversing the tree using the comment.left and comment.right values, but after y

Name of button pressed not in request.POST

2008-10-04 Thread ydjango
I do not see the name of submit button in request.POST. it has all other form fields if request.POST.has_key('save'): does not work too Where can I find which button was pressed. various fields... other input buttons --~--~-~--~~~---~--~~ You received

Re: Q about a ticket and merging into svn

2008-10-04 Thread Gerard Petersen
Russel, Thanx for your elaborate feedback. I'm indeed going to keep the widget code in a file within my own app for now. It's very workable this way, and I still have lots of other Django code to discover. @Malcolm: I'd love to help but being a sysadmin and not a diehard developer, I can not

Serving static file on Windows

2008-10-04 Thread mrsource
I can upload images on the right place in the file system, but then django don't serve them. I'm using the development server and the current SVN version of django. I have this configuration in settings.py: MEDIA_ROOT = 'D:/codice/workspace/aurea/media/' MEDIA_URL = '/media/' ADMIN_MEDIA_PREFIX =

Re: Serving static file on Windows

2008-10-04 Thread Karen Tracey
On Sat, Oct 4, 2008 at 3:19 PM, mrsource <[EMAIL PROTECTED]> wrote: > > I can upload images on the right place in the file system, but then > django don't serve them. > I'm using the development server and the current SVN version of > django. > > I have this configuration in settings.py: > MEDIA_R

GenericRelation

2008-10-04 Thread urukay
Hi, could anyone help me with this please? I'm working on rating system. Each model that can be rated has ARating as a parent. My models: class ARating(models.Model): """Each model which is using ratings should extend this class. """ rates = generic.GenericRelation('Rating')

Re: ManyToManyField edited on admin by both sides?

2008-10-04 Thread Markos Gogoulos
Solved, for reference check http://blog.abiss.gr/mgogoulos/entry/many_to_many_relationships_and On Sep 19, 5:39 pm, Markos Gogoulos <[EMAIL PROTECTED]> wrote: > Hi Jerry > > this doen't work with ManyToManyField > > Exception > has no ForeignKey to > > Regards > > On Sep 19, 4:48 pm, Jerry S

installing tiny mce for flatpages

2008-10-04 Thread Bobby Roberts
hi group. I need some help getting tinymce installed for flatpages in admin. I'm serving static content from an application called /static/ with tinymce located in /static/js/tiny_mce/. I have read the docs on creating an admin.py file and have done that as well but it's not showing the richtex

Re: Flatpages, get_absolute_url() and ABSOLUTE_URL_OVERRIDES

2008-10-04 Thread Erik Allik
from django.core.urlresolvers import reverse def get_flatpage_absolute_url(o): return '%s%s' % (reverse('site-index'), o.url) ABSOLUTE_URL_OVERRIDES = { 'flatpages.flatpage': get_flatpage_absolute_url } Actually I think this would work too: ABSOLUTE_URL_OVERRIDES = { 'flatpag

Re: Recursive relationship - two models, same table

2008-10-04 Thread Steve Holden
Will Temperley wrote: > Hi All > > I have a load of Institutions, some with departments, some not. So I > created a model that can represent this simple hierarchy. See models > at the bottom. > > Fine, but a bit confusing for users, plus if the user just wants to > deal with Institutions alone in

Re: Serving static file on Windows

2008-10-04 Thread mrsource
You're right...the ADMIN_MEDIA_PREFIX is routed before MEDIA_URL. Changing one of them has solved my issue. Carlo On 4 Ott, 21:34, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Sat, Oct 4, 2008 at 3:19 PM, mrsource <[EMAIL PROTECTED]> wrote: > > > I can upload images on the right place in the f

Re: Resizing images when uploading

2008-10-04 Thread varikin
On Oct 3, 4:18 pm, "Juanjo Conti" <[EMAIL PROTECTED]> wrote: > Hi, I used to use a pre 1.0 svn version of Django. There I had this class: > > class Foto(models.Model): >     descripcion = models.CharField(max_length=30, blank=True, > verbose_name=u"descripción") >     imagen = models.ImageField(

Re: add() method on ManyToManyField

2008-10-04 Thread Steve Holden
You could also think about actioning a pre- or post-save signal if that would allow you to access the pieces you need. regards Steve AndyH wrote: > OK... thinking about this, I guess add() on a ManyToManyField is just > a wrapper around the save() method of the model your saving it on to. > I c

Re: mptt + contrib.comments?

2008-10-04 Thread pihentagy
Hi! What about thins project? http://code.google.com/p/django-threadedcomments/ --~--~-~--~~~---~--~~ 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.c

Need help with djangosearch app

2008-10-04 Thread M Godshall
First of all, I'm trying to find a simple search solution that will allow me to search specific fields in a model and display the results according to their relevance (I'm using mysql). After much searching it seemed like the djangosearch app would be the best solution (but I welcome other sugges

Re: Need help with djangosearch app

2008-10-04 Thread M Godshall
After a little work, I realized that it IS performing the search, but it only returns objects with fields that match EXACTLY. Is there any way to make it so it does a partial search as well? Like if a field contains part of that query, it still finds it? On Oct 4, 7:07 pm, M Godshall <[EMAIL P

Re: Django log for admin

2008-10-04 Thread sanrioyt
Thanks Rajesh. This will work. Unfortunately, the last_login field gets overwritten every time the user logs in, but at least, it gives me a starting point. Thanks, sanrio On Oct 2, 3:41 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > > I have an application based around the admin. Is there a wa

Re: Flatpages, get_absolute_url() and ABSOLUTE_URL_OVERRIDES

2008-10-04 Thread Malcolm Tredinnick
On Sat, 2008-10-04 at 09:42 -0700, John Allen wrote: [...] > This works fine but I am wondering: can the function in > ABSOLUTE_URL_OVERRIDES make use of reverse(), so as to avoid hard- > coding the "/cms" into the setting? No, you can't do this. The rule is that you cannot use any pieces of Dja