Re: Django in Vista

2009-08-15 Thread Thiago511
UPDATE: Well I added django-admin.py to my PATH and I still get an error message: python: cannot open 'django-admin.py' : [Errno 2] No such file to directory On Aug 15, 11:30 am, CLIFFORD ILKAY wrote: > On 15/08/09 01:43 PM, Thiago511 wrote: > > > mark how do I add

Re: Using glovar vars

2009-08-15 Thread Graham Dumpleton
On Aug 16, 1:11 am, Jani Tiainen wrote: > Graham Dumpleton kirjoitti: > > > > > > > > > On Aug 14, 10:13 pm, Jani Tiainen wrote: > >> Steve Patrick kirjoitti: > > >>> Hi everybody, > >>> I´m new in Django and maybe my problem is a bit stupid...I would

Re: mod_wsgi question

2009-08-15 Thread Graham Dumpleton
On Aug 16, 11:56 am, tdelam wrote: > Hi Clifford, > > Thanks for replying, so If I understand this correctly, I will need to > recompile mod_wsgi with that directive set to the new python binary? No. It generally should be sufficient to use the --with-python option to

Poor performance on POSTs in production

2009-08-15 Thread Brian Morton
Very strange problem going on with one of my Django sites. This only happens in my production env using Debian stable, Apache 2.2.9 with mod_python and django trunk (updated). All GET requests execute in a timely manner. However, all POSTs take way too long. I've inserted debugging into my

links to dynamic form info

2009-08-15 Thread Noah Watkins
Looking for links to solutions to the following situation: class Book(models.Model): ... class Author(model.Models): book = models.ForeignKey(Book) ... I'd like to design a form for creating books that allows multiple authors to be added before the book form is submitted. Clearly some

Re: mod_wsgi question

2009-08-15 Thread tdelam
Hi Clifford, Thanks for replying, so If I understand this correctly, I will need to recompile mod_wsgi with that directive set to the new python binary? On Aug 15, 9:44 pm, CLIFFORD ILKAY wrote: > On 15/08/09 09:13 PM, tdelam wrote: > > > Hey, > > > On our

Re: mod_wsgi question

2009-08-15 Thread CLIFFORD ILKAY
On 15/08/09 09:13 PM, tdelam wrote: > Hey, > > On our dedicated hosting account is an older version of Python (2.3). > I could not upgrade due to plesk and such relying on that version as > well. I installed Python 2.6 in a different directory /opt/python/ I > have also installed django and some

mod_wsgi question

2009-08-15 Thread tdelam
Hey, On our dedicated hosting account is an older version of Python (2.3). I could not upgrade due to plesk and such relying on that version as well. I installed Python 2.6 in a different directory /opt/python/ I have also installed django and some of the packages I require. Now, my question is

Re: Is there a way to combine ifequal with ifequal/if?

2009-08-15 Thread realfun
On Sat, Aug 15, 2009 at 6:53 PM, Daniel Roseman wrote: > > On Aug 15, 11:21 am, realfun wrote: > > Sigh, seems not better way, sometimes it's ugly also to put them on the > > views.py - A/B/C could be the attribute of an element among a list of > >

Re: Admin interface : 'HttpResponseRedirect' object has no attribute 'rindex'

2009-08-15 Thread 3hux
I came across this error today, and couldn't find any answers about this anywhere on the web. I'm hoping other people will come across this here, and figure out what it took me some time to realize: There is a problem in your urls.py file. Atleast there was definitely a problem with my urls in

Default Image when ImageField is empty

2009-08-15 Thread Leo
Hi all, I would like to know what I need to do to fill an ImageField with a default image when the user does not submit any on the form. thanks, Leo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: View with keyword arguments

2009-08-15 Thread Juanjo Conti
So, positional arguments and keyword ones can't be mixed? 2009/8/15, Raja : > > Is there a reason to mix the positional and keyword arguments. If you > use > def my_view(request,*arg, **kwargs): > .. > > kwargs will contain { 'name': value for the second grouping } and

Re: View with keyword arguments

2009-08-15 Thread Raja
Is there a reason to mix the positional and keyword arguments. If you use def my_view(request,*arg, **kwargs): .. kwargs will contain { 'name': value for the second grouping } and the first group will not be used. -- raja On Aug 15, 5:24 pm, Juanjo Conti wrote: > In

String aggregator

2009-08-15 Thread hyuen
Hi all, I am trying to use aggregators for non-numeric types, say I have a table that looks like FirstName, LastName John Doe John Smith I want to do something like: select FirstName, max(LastName) from T group by FirstName When I use aggregators, I do something like

Re: ManyToMany Model.py and the shell..

2009-08-15 Thread rh0dium
Hey Thanks You were right here is what I ended up doing to get it working.. for item in p4.run(("describe", 122)): entry = Change() entry.change = item['change'] entry.desc= item['desc'] entry.status = item['status'] entry.time=

Re: how much python do i need to know to learn/use Django?

2009-08-15 Thread Yuchan
I learned django with no programming experience and no python -- I couldn't differentitate between python functions and django written in python, but I can say the documentation is so well written, the IRC channel so supportive, that I had no trouble at all. I learned the most taking apart

Re: Django in Vista

2009-08-15 Thread CLIFFORD ILKAY
On 15/08/09 01:43 PM, Thiago511 wrote: > mark how do I add a file to %PATH% ? This isn't a Django issue so much as a (very basic) system administration issue. I suggest you read about the PATH environment variable and grasp that instead of blindly following someone else's instructions about how

Re: Django in Vista

2009-08-15 Thread Thiago511
mark how do I add a file to %PATH% ? On Aug 15, 10:37 am, Maksymus007 wrote: > copy django-admin.py into C:\Python26\Scripts and add this into %PATH% :) > Or add c;\Python26\Lib\site-packages\bin\django-admin to %PATH% but > I'd preffer first one > > On Sat, Aug 15, 2009

Re: Django in Vista

2009-08-15 Thread Maksymus007
copy django-admin.py into C:\Python26\Scripts and add this into %PATH% :) Or add c;\Python26\Lib\site-packages\bin\django-admin to %PATH% but I'd preffer first one On Sat, Aug 15, 2009 at 7:31 PM, Thiago511 wrote: > > oh ok mark, yeah I can see django in site-packages > and

Re: Django in Vista

2009-08-15 Thread Thiago511
oh ok mark, yeah I can see django in site-packages and I see django-admin in the bin folder: c;\Python26\Lib\site-packages\bin\django-admin So why doesn't it open in cmd? On Aug 15, 10:22 am, Maksymus007 wrote: > On Sat, Aug 15, 2009 at 7:18 PM,

Re: Django in Vista

2009-08-15 Thread Maksymus007
On Sat, Aug 15, 2009 at 7:18 PM, Thiago511 wrote: > > python is in %PATH% > Django is not though. > How do I add it to %PATH% ? > > if you installed django by python setup.py install than it is in site-packages directory of Python instalation and having Python in %PATH%

Re: Django in Vista

2009-08-15 Thread Thiago511
python is in %PATH% Django is not though. How do I add it to %PATH% ? On Aug 15, 10:12 am, Robb Bossley wrote: > Still seems to be path issues - this time with the django stuff - thus it > cannot find it. > > > > On Sat, Aug 15, 2009 at 12:34 PM, Thiago511

Re: Django in Vista

2009-08-15 Thread Maksymus007
On Sat, Aug 15, 2009 at 7:08 PM, Thiago511 wrote: > > hey mark, I am following your tutorial, and I am stuck in: > > step 3 > Right list contains Open? If yes, select it and Edit, if not Add. Set > accoring to screenshot below, remeber about python.exe path - may be >

Re: Django in Vista

2009-08-15 Thread Robb Bossley
Still seems to be path issues - this time with the django stuff - thus it cannot find it. On Sat, Aug 15, 2009 at 12:34 PM, Thiago511 wrote: > > Well Sam, I am making some progress. at least I got a different error > message(I am actually excited lol) > here: > > python:

Re: Django in Vista

2009-08-15 Thread Robb Bossley
This is probably a path issue - you need to get python into your %PATH%. On Sat, Aug 15, 2009 at 12:15 PM, Thiago511 wrote: > > python and Django are both installed already > > On Aug 15, 9:11 am, Sam Lai wrote: > > You need to install python then

Re: Django in Vista

2009-08-15 Thread Thiago511
hey mark, I am following your tutorial, and I am stuck in: step 3 Right list contains Open? If yes, select it and Edit, if not Add. Set accoring to screenshot below, remeber about python.exe path - may be different. What screenshot below? On Aug 15, 9:51 am, Maksymus007

Re: Django in Vista

2009-08-15 Thread Maksymus007
On Sat, Aug 15, 2009 at 6:34 PM, Thiago511 wrote: > > Well Sam, I am making some progress. at least I got a different error > message(I am actually excited lol) > here: > > python: can't open file 'django-admin.py': [Errno 2] No such file or > directory > > On Aug 15, 9:25 

Re: Django in Vista

2009-08-15 Thread Thiago511
Well Sam, I am making some progress. at least I got a different error message(I am actually excited lol) here: python: can't open file 'django-admin.py': [Errno 2] No such file or directory On Aug 15, 9:25 am, Sam Lai wrote: > From the tutorial: > > "django-admin.py

Re: Django in Vista

2009-08-15 Thread Sam Lai
>From the tutorial: "django-admin.py should be on your system path if you installed Django via python setup.py." This might be different for Windows - it might not be on the system path. Try: python django-admin.py startproject mysite If that doesn't work, use the full path to your python

Re: Django in Vista

2009-08-15 Thread Thiago511
python and Django are both installed already On Aug 15, 9:11 am, Sam Lai wrote: > You need to install python then django first before trying the > tutorial - start herehttp://docs.djangoproject.com/en/dev/intro/install/ > > 2009/8/16 Thiago511 : > > >

Re: Django in Vista

2009-08-15 Thread Sam Lai
You need to install python then django first before trying the tutorial - start here http://docs.djangoproject.com/en/dev/intro/install/ 2009/8/16 Thiago511 : > > I went to that link you gave me. I tried it, and I go the same error > message. > > they told me to: > > "From

Re: Django in Vista

2009-08-15 Thread Thiago511
I went to that link you gave me. I tried it, and I go the same error message. they told me to: "From the command line, cd into a directory where you’d like to store your code, then run the command django-admin.py startproject mysite. " I cd into the folder I have set up but when I type:

Re: optional username registration

2009-08-15 Thread Dhruv Adhia
yes I got it working. I override the User fields inside contrib.auth.models and also override UserManager in which I removed username as one of the necessary argument while calling 'create_user' method. Now I have call like this CustomUser.objects.create_user(# check for cleaned email,

Re: am i missing something ?

2009-08-15 Thread Nicolas Aggelidis
> returns a QuerySet, not a single instance of a user.  If you want it to be a > single instance, change the 'filter' call to 'get'.  As it is your {{ user > }} in the template is "working" because it prints the representation of the > query set, but the attempts to access the individual User

Re: Django in Vista

2009-08-15 Thread Daniel Roseman
On Aug 15, 4:05 pm, Thiago511 wrote: > Hi guys, I am trying to start a Django project in Vista(I am not even > sure I know how to start one!) > here is what I try to do: > > I don't think I even activated Django-admin > > How would I go about doing that? > > The Django

file list with os.walk non unicode chars like spanish ~n

2009-08-15 Thread fruity
Hi everyone, This is not my code, but the code of washtub the liquidsoap controller made with django so for I've mailed both ML, django and liquidsoap I have a directory full of any kind of files, some of this filenames are in latin1 and when I run my django app I get UnicodeDecodeError like

Django in Vista

2009-08-15 Thread Thiago511
Hi guys, I am trying to start a Django project in Vista(I am not even sure I know how to start one!) here is what I try to do: I don't think I even activated Django-admin How would I go about doing that? The Django website tells me to add django.contrib.admin to my INSTALLED_APPS settings ok.

Re: Using glovar vars

2009-08-15 Thread Jani Tiainen
Graham Dumpleton kirjoitti: > > > On Aug 14, 10:13 pm, Jani Tiainen wrote: >> Steve Patrick kirjoitti: >> >>> Hi everybody, >>> I´m new in Django and maybe my problem is a bit stupid...I would like >>> to use a global variable (for all the application) to store some info >>

Re: How to tidy up data returned by raw sql has u'blahblah'

2009-08-15 Thread Daniel Roseman
On Aug 15, 3:16 pm, adelaide_mike wrote: > OK, and thanks.  I asked the wrong question in that case.  The correct > question might be how do I transfer the data in the returned rows, > which is several columns from various tables, into distinct fields on > a rendered

Re: How to tidy up data returned by raw sql has u'blahblah'

2009-08-15 Thread adelaide_mike
OK, and thanks. I asked the wrong question in that case. The correct question might be how do I transfer the data in the returned rows, which is several columns from various tables, into distinct fields on a rendered page? I am assuming that this process will remove the Python unicode

Re: Question about URLs

2009-08-15 Thread Léon Dignòn
At this point I always love to refer to http://rubular.com, which is a very good regular expression editor and tester. leon On Aug 11, 1:42 am, Tim Chase wrote: > > If i have a URL such as: > > >  (r'^(?P\w+)/blog/', include('foo.urls.blog')), > > > what are the

Re: Notify about a bug

2009-08-15 Thread Karen Tracey
On Sat, Aug 15, 2009 at 4:02 AM, Peter2108 wrote: > > > > As for why the patch has not been checked in -- the person who supplied > the > > patch subsequently marked the ticket as "patch needs improvement" noting > > that the patch addressed only one aspect of the reported

Re: optional username registration

2009-08-15 Thread Léon Dignòn
Sorry, I assumed you used django-registration. But the idea is the same until you did not set up an own user model. :) On Aug 15, 3:11 pm, Léon Dignòn wrote: > django-registration uses the django.contrib.auth module which includes > the models.User model. in this model it

Re: optional username registration

2009-08-15 Thread Léon Dignòn
django-registration uses the django.contrib.auth module which includes the models.User model. in this model it is necessary to supply a username, but not an e-mail address. I assume you want to authenticate users via the e-mail address, then you'd simply copy the e-mail address into the username

Re: ManyToMany Model.py and the shell..

2009-08-15 Thread Léon Dignòn
Hello rh0dium, Client.objects.filter() returns you a QuerySet instance which you have to iterate to get all objects. Thus the commented line will generate an error, I think so. Instead you should use Client.objects.get() to get the model instance. A QuerySet is a list of model instances. > Can

Re: View with keyword arguments

2009-08-15 Thread Juanjo Conti
In the examples seems not to be mixed, positional and keyword arguments http://docs.djangoproject.com/en/dev/topics/http/urls/ 2009/8/15 Juanjo Conti : > Which is the correct signature for a view to be used with this url > ^vista/ejemplo1/(\d{3})/(?P\d{3})/$ ? > - > Juanjo

View with keyword arguments

2009-08-15 Thread Juanjo Conti
Which is the correct signature for a view to be used with this url ^vista/ejemplo1/(\d{3})/(?P\d{3})/$ ? - Juanjo Conti --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Intermediary model and filter_horizontal problem

2009-08-15 Thread Jean Stebens
Hi All, My Problem: I'm adapting the generated models from inspectdb in order to use a legacy application with django. The application database schema has intermediary tables in it - I'd want to use the nice "filter_horizontal" instead of inlines. Inlines do work, so the intermediary table

Re: user profiles and the admin

2009-08-15 Thread consiglieri
Are you iterating over the list in the template? On 28 Juli, 23:01, Asinox wrote: > im new , but i think that u need this part: > > class UserProfileAdmin(UserAdmin): >     inlines = [UserProfileInline] >     list_display = ('user', 'sex','phone') > > regards, > > On Jul 28,

Re: ModelForm's is_valid() returns False, but I don't know why.

2009-08-15 Thread Daniel Roseman
On Aug 15, 2:54 am, George Laskowsky wrote: > I have the following code (simplified): > > # models.py > > class Historico(models.Model): >      fechaCreacion =     models.DateTimeField(auto_now_add=True) >      fechaModificacion = models.DateTimeField(auto_now=True) >

Re: Is there a way to combine ifequal with ifequal/if?

2009-08-15 Thread Daniel Roseman
On Aug 15, 11:21 am, realfun wrote: > Sigh, seems not better way, sometimes it's ugly also to put them on the > views.py - A/B/C could be the attribute of an element among a list of > elements. Say, A is x.A, B is y.B, C is z.C, then you need to create a tuple > for them on

Re: Newbie - question - Django Tutorials 2

2009-08-15 Thread Daniel Roseman
On Aug 15, 11:22 am, salai wrote: > Dear Léon, > > Thankyou. > > hmm.. It is strange.! ( indentation error)! > >  But, after restarting the server, my Polls APP is not in admin area >  loaded. It always happened, when I got an error message. > >  many thanks in advance, > >  

Re: Newbie - question - Django Tutorials 2

2009-08-15 Thread salai
Dear Léon, Thankyou. hmm.. It is strange.! ( indentation error)! But, after restarting the server, my Polls APP is not in admin area loaded. It always happened, when I got an error message. many thanks in advance, regards, koko On Fri, Aug 14, 2009 at 11:58 PM,

Re: Is there a way to combine ifequal with ifequal/if?

2009-08-15 Thread realfun
Sigh, seems not better way, sometimes it's ugly also to put them on the views.py - A/B/C could be the attribute of an element among a list of elements. Say, A is x.A, B is y.B, C is z.C, then you need to create a tuple for them on views side, and thus make a coupling for the order in the tuple.

Re: user profiles and the admin

2009-08-15 Thread Léon Dignòn
Hey Chris, have you found a solution? On Jul 29, 2:43 pm, Chris Curvey wrote: > Drat.  That's not it.  I'll keep trying. > > On Jul 28, 5:01 pm, Asinox wrote: > > > > > im new , but i think that u need this part: > > > class UserProfileAdmin(UserAdmin):

Re: ModelForm's is_valid() returns False, but I don't know why.

2009-08-15 Thread Tom
Not sure if this will create the problem you describe, but I believe (and I could be wrong) that the 'verbose_name' argument is only used for ForeignKey, ManaytoMany, and OnetoOne fields (because the first argument must be a model class). I think that your descripcion field should look like

Re: How to tidy up data returned by raw sql has u'blahblah'

2009-08-15 Thread Daniel Roseman
On Aug 15, 5:23 am, adelaide_mike wrote: > My raw sql returns a list of data very nicely, except that character > cols have data surrounded by u'', and dates have datetime.date > (2009-01-01) etc. > > In my newbie innocence I have not discovered how to remove these >

Re: Override __init__()

2009-08-15 Thread Léon Dignòn
Now it's working!!! class ProfileForm(ModelForm): first_name = forms.CharField(required=False, max_length=30) last_name = forms.CharField(required=False, max_length=30) class Meta: model = UserProfile exclude = ('user',) # User will be filled in by the view. def

Re: textarea in admin

2009-08-15 Thread zignorp
I just solved the first part, I was using charField, and I should have been using textField. I'm hoping that the data type in the sqlite db remains the same, there is varchar and text, but I'm thinking it should be varchar. On Aug 15, 12:55 am, zignorp wrote: > I just solved

Re: Notify about a bug

2009-08-15 Thread Peter2108
> > Since you've commented on the ticket, you'll automatically get mail when > anyone updates the ticket.  The other way to ensure you get updates in email > is to add yourself to the cc list Good. . > > As for why the patch has not been checked in -- the person who supplied the > patch

Cherrpy WSGI server timeout

2009-08-15 Thread cainus8
Hi, I'm using cherrypy WSGI server to serve up django. I need requests to timeout if they haven't resolved within 10 seconds. Apparently connection are supposed to timeout after 10 seconds by default, but if i make a request that doesn't resolve it just hangs indefinitely. Why is this? Thanks

Re: textarea in admin

2009-08-15 Thread zignorp
I just solved the 2nd part of my problem, which was changing one of the multi-select boxes into one that would handle more data better: I added the filter_horizontal command, think that'll be better when it gets longer. I'm still looking to change my one line input field into a textarea, though.

Re: Override __init__()

2009-08-15 Thread Léon Dignòn
I just tried that, but how can I access first_name in instance? instance.user.first_name ist not working. What I like to achieve is that instance.user.first_name is displayed in the textfield called also first_name, which is an additional field in my ModelForm. :/ Saving the additional field was

textarea in admin

2009-08-15 Thread zignorp
Hello, I'm reading all about using tinymce in django's admin to replace a textarea, which is great, but I'm still trying to learn how to get the admin to display my description field as a textarea. I'm reading the documentation about the ModelAdmin Options, but I'm not quite getting that part.