Re: Spam filters for Django?

2010-09-03 Thread Kenneth Gonsalves
On Fri, 2010-09-03 at 22:25 -0700, Andy wrote: > Only logged in users will be allowed to post. But that wouldn't stop > spammers from logging in and posting spam. depends on how the registration works. What I do is: 1. person fills in his username and email address 2. he gets a mail with a link

Re: Spam filters for Django?

2010-09-03 Thread Andy
Only logged in users will be allowed to post. But that wouldn't stop spammers from logging in and posting spam. An example is Apple's new social network, Ping. Only logged in users are allowed to post comments there. But it's still flooded with spam immediately after its launch:

Re: Spam filters for Django?

2010-09-03 Thread Kenneth Gonsalves
On Fri, 2010-09-03 at 21:56 -0700, Andy wrote: > I'm working on a Django-based site that consists mostly of user- > generated content: reviews, comments, tweet_like posts, etc. > > I'm concerned about spam. Are there any spam filters available for > Django? If not, what types of algorithm can be

Spam filters for Django?

2010-09-03 Thread Andy
I'm working on a Django-based site that consists mostly of user- generated content: reviews, comments, tweet_like posts, etc. I'm concerned about spam. Are there any spam filters available for Django? If not, what types of algorithm can be used for spam filtering? On a more general note, does

Re: Composite Primary Key Support

2010-09-03 Thread Russell Keith-Magee
On Sat, Sep 4, 2010 at 7:17 AM, Brendon wrote: > I have a project where we have an existing database which uses > composite (multiple) primary keys for some of the tables. I want to > move everything over from PHP into DJango without changing the DB. > Reading the

Composite Primary Key Support

2010-09-03 Thread Brendon
I have a project where we have an existing database which uses composite (multiple) primary keys for some of the tables. I want to move everything over from PHP into DJango without changing the DB. Reading the DJango docs though, it seems composite primary keys are not supported. I looked online

Query Set Problem

2010-09-03 Thread tresero
I want to convert this query: SELECT c.id, c.buy_long, c.stop_sell, c.sell_short, c.stop_buy, c.the_date, p.symbol, s.open_price, s.high_price, s.low_price, s.close_price FROM csbuysell c, onepair p, dailystats s WHERE

Regrouping forms in formsets

2010-09-03 Thread Felix H.
Hi! I'd like to structure a formset of a given model by an attribute of the model, just as the regroup template tag would do. Therefore, I tried to apply regroup as one would outside a formset: {% regroup formset.forms by attribute as forms_by_attribute %} {% for group in forms_by_attribute %}

Re: django model filter

2010-09-03 Thread Justin
Well, I'm glad it works. Please post, if you want to, a cleaner solution if you find it! -Justin -- 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

Re: admin panel fieldsets for different type of users?

2010-09-03 Thread JHeasly
Also wondering the exact same thing, so +1 on any pointers/hints/ help ... On Aug 1, 3:50 am, gondor wrote: > I use formset in my admin panel to group/title my related fields. > This works great except when I go to exclude some fields for lesser > users. > > In the simple

Re: ANN: PyMySQL 0.3

2010-09-03 Thread Andy
Pete, Would you recommend PyMySQL for production use? Which parts of Django do I need to modify in order to use it with PyMySQL instead of MySQLdb? Thanks. On Sep 3, 2:07 pm, Pete Hunt wrote: > I’m proud to announce the release of PyMySQL 0.3. For those of you >

Re: django model filter

2010-09-03 Thread spearsear
I did it in your way, it certainly works. But I feel this is a little ugly. My query is way more complicated that the example here so I had to do if a lot. On Sep 3, 8:29 am, Justin wrote: > Off the top of my head, you could do something like this: > > import math > import

Re: custom file validation

2010-09-03 Thread deecodameeko
My bad...twas failiing cuz I didn't spell enctype properly...all good. On Sep 3, 11:50 am, deecodameeko wrote: > Thanks guys, > > I switched to using the clean method to check multiple fields however > the file is always None even if I have browsed and found a file I want

Re: django-twitter-oauth connection refused

2010-09-03 Thread Bill Freeman
No. I'm not actually using twitter anywhere. I just remember the email saying that the API changed on Tuesday, so I'm not surprised if things that worked before are broken now. On Fri, Sep 3, 2010 at 10:26 AM, ashwin morey wrote: > Hi Bill, > > Did you try using

Re: potential issue re in memory django file uploading.

2010-09-03 Thread James Bennett
On Fri, Sep 3, 2010 at 2:04 PM, dave b wrote: > Ok no movement :) Nor is there likely to be. Insofar as you've identified a problem at all, it's a problem in a piece of software that isn't Django, and you've ignored multiple people who've pointed that fact out to you

Re: Template syntax

2010-09-03 Thread Daniel Roseman
On Sep 3, 5:14 pm, Javier Guerra Giraldez wrote: > On Fri, Sep 3, 2010 at 11:10 AM, Bradley Hintze > > wrote: > > -In my template I put {{ param1.0 }}, expecting to see the first list > > in the list of lists. > > Result: nothing was printed to

Re: potential issue re in memory django file uploading.

2010-09-03 Thread dave b
Ok no movement :) Lighttpd has a default limit of 2gb, cherokee seems to have the same. Pin it on the httpd all you like - but the default apache has no limit (0 - unlimited :) ). http://httpd.apache.org/docs/2.0/mod/core.html#limitrequestbody -- The better part of valor is discretion.

Re: customize url for GET form

2010-09-03 Thread jean polo
ah ok, I was expecting something like that .. this is only for a *very* special case though, not for my normal form thingz.. thanks for all the advices ! cheers, _y On Sep 3, 6:39 pm, Tom Evans wrote: > On Fri, Sep 3, 2010 at 5:05 PM, jean polo

ANN: PyMySQL 0.3

2010-09-03 Thread Pete Hunt
I’m proud to announce the release of PyMySQL 0.3. For those of you unfamiliar with PyMySQL, it is a pure-Python drop-in replacement for MySQLdb with an emphasis on compatibility with MySQLdb and for various Python implementations. I started working on the project due to my frustrations stemming

Re: extending User

2010-09-03 Thread djnubbio
takn again On 3 Set, 18:40, Shawn Milochik wrote: > Yes, the password stored will only ever be the hash type, hash salt, > and hash. You should never store it in plain text. > > If you're interested you can look at the actual model. You might be > interested in these

Re: How to display the user profile in the admin interface?

2010-09-03 Thread João Rodrigues
I fixed this in admin.py: from django.contrib.auth.admin import UserAdmin class UserProfileInline(admin.StackedInline): model = UserProfile class UserWithProfileAdmin(UserAdmin): inlines = [UserProfileInline] admin.site.unregister(User) admin.site.register(User, UserWithProfileAdmin)

Re: extending User

2010-09-03 Thread Shawn Milochik
Yes, the password stored will only ever be the hash type, hash salt, and hash. You should never store it in plain text. If you're interested you can look at the actual model. You might be interested in these functions: set_password(), get_hexdigest(), and check_password(). These make it clear

Re: customize url for GET form

2010-09-03 Thread Tom Evans
On Fri, Sep 3, 2010 at 5:05 PM, jean polo wrote: > ok sorry if I used a bad example with id.. > I meant something like: > xx?bla=1,2,3,4 > > I got it working by using a special field ('bla') in my form which is > a CharField > then I parse bla: > arr =

Re: Template syntax

2010-09-03 Thread Bradley Hintze
So is there a way to access/index lists within the template? On Fri, Sep 3, 2010 at 12:14 PM, Javier Guerra Giraldez wrote: > On Fri, Sep 3, 2010 at 11:10 AM, Bradley Hintze > wrote: >> -In my template I put {{ param1.0 }}, expecting to see the

Re: Template syntax

2010-09-03 Thread Javier Guerra Giraldez
On Fri, Sep 3, 2010 at 11:10 AM, Bradley Hintze wrote: > -In my template I put {{ param1.0 }}, expecting to see the first list > in the list of lists. > Result: nothing was printed to the page. that zero becomes a string '0', not a numeric 0. IOW, it's not param[0],

Re: Template syntax

2010-09-03 Thread Bradley Hintze
The dot does not work. As a test I did the following: -In my template I put {{ param1 }}, param1 is a list of lists. Result: param1, the lists of lists were printed to the page. -In my template I put {{ param1.0 }}, expecting to see the first list in the list of lists. Result: nothing was

Re: customize url for GET form

2010-09-03 Thread jean polo
ok sorry if I used a bad example with id.. I meant something like: xx?bla=1,2,3,4 I got it working by using a special field ('bla') in my form which is a CharField then I parse bla: arr = request.GET.get('bla').split(',') if all items of arr are integers, I have my array of 'bla' =) cheers,

Re: custom file validation

2010-09-03 Thread deecodameeko
Thanks guys, I switched to using the clean method to check multiple fields however the file is always None even if I have browsed and found a file I want to upload. def clean(self): cleaned_data = self.cleaned_data store_id = cleaned_data.get('store_id')

RE: mod_wsgi, apache, windows XP

2010-09-03 Thread Anna Leslie
This is in my settings file: 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. And it works fine with the local django server. The entire application works fine with the local django server, but I need to get it

Re: AttributeError at /admin/ when logging into the default Admin site.

2010-09-03 Thread Federico Maggi
On 03/set/2010, at 17:42, "daniel.osterme...@gmail.com" wrote: > There was another issue raised that sounded a little similar, where > the problem was the that django 1.2 was installed over the top of > 1.0. I've installed it as documented, but I do have both 1.0

Re: extending User

2010-09-03 Thread djnubbio
a, ok tank you. Your post clarify me much woolly things in my mind. So I understand that password field will not be treated in standard manner, and it needs to be managed very carefully. Its purpose is only to store the final encrypted password, isn't it? On 3 Set, 17:14, Shawn Milochik

Re: custom file validation

2010-09-03 Thread ringemup
Two things going on here: 1) Validation that involves checking multiple fields should be done in the form's clean() method rather than its clean_FIELDNAME method. Not all fields are guaranteed to have been added to cleaned_data until you reach the clean() method. 2) Try using

Re: custom file validation

2010-09-03 Thread Shawn Milochik
Any validation which has to do with multiple fields should be done in the clean() override, not within the individual field validator. You can't rely on cleaned_data existing before that point.

Re: extending User

2010-09-03 Thread Shawn Milochik
You should exclude the password field in your overridden model form. If you want to have a password added at the time of user registration then you can add an additional charfield to the form (make sure to use the "password" widget). You should probably add two such fields so you can compare them

custom file validation

2010-09-03 Thread deecodameeko
Hi, I have a file in a form. The file is optional but if the file is not None, then some other form fields are required as well. For example the following code checks one of the fields that's required when the file fields isn't empty: file= forms.FileField(required=False) def

Re: extending User

2010-09-03 Thread djnubbio
here they are: import string # Django settings for djapps project. #... modifica ng ROOT_URLCONF = 'djapps.urls' import os PROJECT_DIR = os.path.dirname(globals()["__file__"])

Re: AttributeError at /admin/ when logging into the default Admin site.

2010-09-03 Thread daniel.osterme...@gmail.com
>   do you run into the same problem if you remove that 'optiver' stuff? I can not say that I have tried. That is the application that I am developing. The only point of interest in it would be that non of the views require a login, and whilst I make use of the request.session, I've checked and

Re: django-twitter-oauth connection refused

2010-09-03 Thread ashwin morey
Hi Bill, Did you try using django-twitter-oauth http://github.com/henriklied/django-twitter-oauth#readme? I got the error while using this app. thanks ashy On Fri, Sep 3, 2010 at 7:46 PM, Bill Freeman wrote: > There was an email from twitter to it's users, yesterday or

Re: extending User

2010-09-03 Thread Federico Maggi
On 03/set/2010, at 12:54, djnubbio wrote: > How can I handle it? which function have i to attach to that url? Could you tell us your urls and settings, and in particular the INSTALLED_APPS variable? -- You received this message because you are subscribed to

Re: django-twitter-oauth connection refused

2010-09-03 Thread Bill Freeman
There was an email from twitter to it's users, yesterday or the day before, saying that they've changed their auth API. I think it was a change to requiring OAUTH, but you may want to check whether port or SSL changes have occurred. On Fri, Sep 3, 2010 at 10:08 AM, ashy

django-twitter-oauth connection refused

2010-09-03 Thread ashy
Hi All, I am using django-twitter-oauth app in my project, but I am getting the following error while trying to connect to twitter.com. Exception Value:(111, 'Connection refused') Exception Location: /usr/lib/python2.6/socket.py in create_connection, line 514 token =

Re: Chat application in Django

2010-09-03 Thread Shamail Tayyab
Hi Ivan, This looks promising, could you also throw some light on how hosting friendly this set up will be? Thanks On Fri, Sep 3, 2010 at 7:13 PM, Salman (shaq) Haq wrote: > Hi guys, > > I am the author of a 'A simple experiment with Hookbox' (see below). > > Just

Re: customize url for GET form

2010-09-03 Thread Alexandre González
Wel... but to do this, you must to catch the url and get from it... but really, with urls.py can you do that? Perhaps, with a regex line in urls.py as: (^\d+)?(/\d+)*/?$ you can get all the number style: http://url/1/2/3/4/5... but I don't know how do it exactly. On Fri, Sep 3, 2010 at 15:46,

Re: Chat application in Django

2010-09-03 Thread Salman (shaq) Haq
Hi guys, I am the author of a 'A simple experiment with Hookbox' (see below). Just wanted chime in and say that Hookbox is under development right now but it is looking very promising. A few people have deployed chat applications for high traffic websites using it already. The simplicity of

Re: customize url for GET form

2010-09-03 Thread Tom Evans
2010/9/3 Alexandre González : > I think that if you use id=1=2=3 you are overriding the id value... > It's no way to do that with GET > Au contraire: >>> from django.http import QueryDict >>> QueryDict('id=1=2=3') Cheers Tom -- You received this message because you

Re: customize url for GET form

2010-09-03 Thread jean polo
well it was just to simplify some URLs but if you guys tell it's bad practice, I'll stick with it =) cheers, _j On Sep 3, 3:26 pm, Daniel Roseman wrote: > Why would you want to? The first is the standard HTTP method of > sending multiple items in a GET (and indeed in a

Re: customize url for GET form

2010-09-03 Thread Alexandre González
I think that if you use id=1=2=3 you are overriding the id value... It's no way to do that with GET On Fri, Sep 3, 2010 at 15:20, jean polo wrote: > hello > while using GET form, I can select several objects with an URL like: > xx?id=1=2=3 etc.. > > How could I

Re: customize url for GET form

2010-09-03 Thread Daniel Roseman
On Sep 3, 2:20 pm, jean polo wrote: > hello > while using GET form, I can select several objects with an URL like: > xx?id=1=2=3 etc.. > > How could I have instead an URL like that: > xx?id=1,2,3,4 etc... ?? > > Thanks, > _j Why would you want to? The first is

customize url for GET form

2010-09-03 Thread jean polo
hello while using GET form, I can select several objects with an URL like: xx?id=1=2=3 etc.. How could I have instead an URL like that: xx?id=1,2,3,4 etc... ?? Thanks, _j -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Customising errors in a form according to user region

2010-09-03 Thread Sithembewena Lloyd Dube
Thanks Kenneth! On Fri, Sep 3, 2010 at 2:09 PM, Kenneth Gonsalves wrote: > On Fri, 2010-09-03 at 14:07 +0200, Sithembewena Lloyd Dube wrote: > > Basically, I wish to validate the name, surname and email fields when > > a user > > hits submit on the form. However, I need to

Re: AttributeError at /admin/ when logging into the default Admin site.

2010-09-03 Thread Federico Maggi
Hi, On Sep 3, 2010, at 7:42 AM, daniel.osterme...@gmail.com wrote: > Any help would be appreciated. do you run into the same problem if you remove that 'optiver' stuff? -- Fede -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Dynamically changing output of SelectMultiple in admin

2010-09-03 Thread j.koch
First a short description of the issue: I'm trying to create a module-system similar to the one in Joomla!, where modules (small information-widgets) can be shown in different positions on different pages of the website. I'm using the django-treemenus app for the menu-structure of the website,

Re: Customising errors in a form according to user region

2010-09-03 Thread Kenneth Gonsalves
On Fri, 2010-09-03 at 14:07 +0200, Sithembewena Lloyd Dube wrote: > Basically, I wish to validate the name, surname and email fields when > a user > hits submit on the form. However, I need to show validation messages > in the > appropriate language based on the user's selected region. How would I

Customising errors in a form according to user region

2010-09-03 Thread Sithembewena Lloyd Dube
Hi folks, I have a Django form defined as follows: class SubscriberForm(ModelForm): class Meta: model = Subscriber The Subscriber model is as follows: class Subscriber(models.Model): name =models.CharField(max_length=255) surname =

Re: third party application with Django

2010-09-03 Thread Max Countryman
Why not set that up within Apache? On Sep 3, 2010, at 4:30, Goran wrote: > I need to install some php application (forum) in some folder domain/ > forum How can I do this? Django 1.2 Appache with FastCgi, shared > hosting. Is it possible to exclude url "domain/forum" from

Re: How to share Custom Template Tag in other APP?

2010-09-03 Thread Daniel Roseman
On Sep 3, 9:27 am, funcrush wrote: > Hi, all. > I wrote a custom template tag package in a app that named Blogs. > And I made other app named SMS. > But I don't know how to use the custom template tag that located Blogs > in SMS app. > If anybody know, please help me. >

How to share Custom Template Tag in other APP?

2010-09-03 Thread funcrush
Hi, all. I wrote a custom template tag package in a app that named Blogs. And I made other app named SMS. But I don't know how to use the custom template tag that located Blogs in SMS app. If anybody know, please help me. thank you :) -- You received this message because you are subscribed to

Re: mod_wsgi, apache, windows XP

2010-09-03 Thread Reinout van Rees
On 09/03/2010 12:34 PM, Graham Dumpleton wrote: On Sep 3, 7:46 am, Jesse wrote: My server error is: TemplateSyntaxError: Caught ImproperlyConfigured while rendering: 'django.db.backends.postgresql_psycopg2' isn't an available database backend. [Thu Sep 02 13:46:30 2010]

Re: Very slow page load in production with mod_wsgi

2010-09-03 Thread Dirk Eschler
Am Freitag 03 September 2010, 12:05:47 schrieb Graham Dumpleton: > On Sep 3, 7:45 pm, Dirk Eschler wrote: > > Hello, > > > > i experience slow page loads in production using mod_wsgi. The django > > debugging toolbar reveals a very high CPU use with lots of voluntary > >

Re: mod_wsgi, apache, windows XP

2010-09-03 Thread Graham Dumpleton
On Sep 3, 7:46 am, Jesse wrote: > Hello Graham, > > I have the c:/public/apache/apache_django_wsgi.conf working now, at > least apache restarts.  Do you know if mod_wsgi has a problem with > these versions: > python 2.7 and apache 2.2, and postgres 8.4, psycopg 2.2.2 > > My

Re: mod_wsgi, apache, windows XP

2010-09-03 Thread Reinout van Rees
On 09/02/2010 11:46 PM, Jesse wrote: Hello Graham, I have the c:/public/apache/apache_django_wsgi.conf working now, at least apache restarts. Do you know if mod_wsgi has a problem with these versions: python 2.7 and apache 2.2, and postgres 8.4, psycopg 2.2.2 My server error is:

Re: Very slow page load in production with mod_wsgi

2010-09-03 Thread Graham Dumpleton
On Sep 3, 7:45 pm, Dirk Eschler wrote: > Hello, > > i experience slow page loads in production using mod_wsgi. The django > debugging toolbar reveals a very high CPU use with lots of voluntary context > switches: > > Production (Apache mod_wsgi-3.2, daemon mode, 10 threads):

extending User

2010-09-03 Thread djnubbio
Hi all, i'm new to django...sorry for wasting your preciouse time my question: i'm extending User model; all seems ok and working; however when adding a new user in the form derived from ModelForm a field password is displayed like the following: password: ___ Usa

Very slow page load in production with mod_wsgi

2010-09-03 Thread Dirk Eschler
Hello, i experience slow page loads in production using mod_wsgi. The django debugging toolbar reveals a very high CPU use with lots of voluntary context switches: Production (Apache mod_wsgi-3.2, daemon mode, 10 threads): User CPU time3580.224 msec System CPU time 156.010 msec Total CPU

Re: windows7, django-admin.py, system variables, no module named django.core

2010-09-03 Thread gintare
Hello, I mean the correct way of running django seems to be to add to windows environmental variable PATH c:/first/Python26/Lib/site-packages/ Django-1.2.1/django/bin and when run $ cmd $ django-admin.py startproject mysite the question, why importing management from django.core do not work?

third party application with Django

2010-09-03 Thread Goran
I need to install some php application (forum) in some folder domain/ forum How can I do this? Django 1.2 Appache with FastCgi, shared hosting. Is it possible to exclude url "domain/forum" from django somehow? -- You received this message because you are subscribed to the Google Groups "Django

Re: windows7, django-admin.py, system variables, no module named django.core

2010-09-03 Thread gintare
Thanks a lot! Would like to clearify how i should run python from command line: 1) cmd #in command line shell under windows cd c:/first/Pyhton26 #change to directory with pyhton executable python # to start python environment in comman

Re: PIL on 10.6 = PAIN

2010-09-03 Thread shofty
I hope I'm not massively missing the point here, but once you set virtualenv up, just use pip to install PIL in there. it works perfect for me every time. Matt -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email