Re: Automatically creating fields

2010-09-21 Thread tsmets
I think, one of the question is also ... What are these fields for ... ? If they are derived values like : is_firstname_filled or is_age_above_18 you should then just implement a method ... but bottom line, it looks much simpler / efficienter / safer to implement it (as an attribute or a method) in

Re: adding a summary field to a model

2010-08-19 Thread tsmets
You replied faster than me Mathieu :) It looks the easiest solution unless the SUM is potentially heavy on the system... There are of course other means to circumvent the issue but it going further & further in the denormalization process (it is not an issue per se ... you just have to be aware of

Re: Generic Relations: questions

2010-08-19 Thread tsmets
The more generic is yr model, the more you will find these. and of course these join tables can grow exponentially ! What you can do is add extra fields to navigate faster or allow partitioning of the table (it helps but not in all circumstances) IMHO Unless you are working for Yahoo/Google/FB/...

Re: Any job queue systems that integrates with Django & allow scheduling jobs by date?

2010-08-18 Thread tsmets
Andy, I think you need to look at http://code.google.com/p/django-command-extensions/ I have never used the create_jobs but I use extensievely the scripting possibility for my developpment & to prepare the json files for my unit testing... Rgds, \T, On Aug 18, 2:10 am, Andy wrote: > I have a

Re: Django on Mac OS X

2010-08-10 Thread tsmets
My feeling is that you are now hitting a bug from your app & not a django / python / mac / ... issue. A stupid gess from me ... You use a Custom Profile for the User and it is an upgrade from Django 1.1 and ... you need to adapt the minor details about it . If you code is in a SVN server I can do a

Re: Django on Mac OS X

2010-08-09 Thread tsmets
Daniel, Did you manage to have the application running on sqlite3 ... ? I develop on Mac & have few issues... so may be you could first ensure everything is working without postgresql connector ... ? \T, On Aug 9, 4:24 am, Daniel França wrote: > tried, nothing :( > I'm getting crazy with Mac OS

Displaying a derived value in the admin console

2010-07-06 Thread tsmets
Hi, Reading http://docs.djangoproject.com/en/dev/ref/contrib/admin/, I am a bit confused on how to display the age of a person in the admin- console. class UserProfile(models.Model): """ """ user = models.ForeignKey(User, unique=True) addresses = models.ManyToManyField(Address, through=

Re: django simple captcha issue

2010-07-02 Thread tsmets
No stack trace ... ? What parts are you using text-to-speech... ? How did you configure it ... ? On Jul 1, 9:52 pm, weiwei wrote: > Hi all, > > I am using django-simple-captcha, it works fine on my dev environment > (windows). But after i deployed to linux server, all other views/pages > are wo

Re: Managing the balance between SSL and impact on the server

2010-07-02 Thread tsmets
>From a deployment perspective, it is better to have "one" front-end server that has the site certificate. That server would then redirect the traffic to the the internal server, either in SSL (other encryption keys) or in plain HTTP. That SSL server needs to be pretty powerfull has it is the one

Re: /i18n/setlang/ broken?

2010-07-02 Thread tsmets
omatically ... ? \T, On Jun 30, 3:04 am, tsmets wrote: > To make your code more portable, I would suggest to have settings.py > file as follow : see below. > It is still unclear to me what needs to be done to catch up the > language in my profile. > Another issue I have is that al

Re: /i18n/setlang/ broken?

2010-06-29 Thread tsmets
To make your code more portable, I would suggest to have settings.py file as follow : see below. It is still unclear to me what needs to be done to catch up the language in my profile. Another issue I have is that all the languages are shown ... How to limit the number of languages to a sub-set (in

Re: generate localized message on Mac OS-X

2010-06-27 Thread tsmets
rote: Thomas-SMETSs-MacBook-Pro: tsmets$ xgettext xgettext.pl        xgettext5.10.0.pl  xgettext5.8.9.pl -- 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 f

generate localized message

2010-06-26 Thread tsmets
My django application root directory on my Mac is : /Users/tsmets/Documents/python// Under that folder I have the following directory structure : Thomas-SMETSs-MacBook-Pro: tsmets$ find . -d 1 ./.svn ./__init__.py ./Base ./clean_unused.sh ./constants.py ./fixtures ./formats ./Health

Re: syncdb always indicates there are no fixtures

2010-06-12 Thread tsmets
m/p/django-command-extensions/ Installation is clearly explained : setup.py build setup.py install the add the extension to your installed apps. \T, On Jun 11, 10:21 pm, eXt wrote: > On 11 Cze, 12:19, tsmets wrote: > > > The problem was just the naming convention ... > >

Re: syncdb always indicates there are no fixtures

2010-06-11 Thread tsmets
name='Spain')) countries.append(Country(iso_code='CR', name='Croatia')) countries.append(Country(iso_code='HU', name='Hungary')) for ctry in countries: ctry.save() [/code] On Jun 11, 12:06 pm, Alexandre González wrote: > ¿Are you sett

Re: How to serve a static html file instead of rendering it as a template.

2010-06-11 Thread tsmets
I think it is all explained in here : http://docs.djangoproject.com/en/dev/howto/static-files/ As mentionned by every body around... It is ok in DEV but ... you should not do so in other environment. \T, On Jun 11, 8:12 am, lalaba wrote: > Hi all, > I am wondering how I can serve an html file

syncdb always indicates there are no fixtures

2010-06-11 Thread tsmets
When I run the syncdb : [code] Thomas-SMETSs-MacBook-Pro:sportotop tsmets$ ./manage.py syncdb Creating table auth_permission Creating table auth_group_permissions Creating table auth_group Creating table auth_user_user_permissions Creating table auth_user_groups Creating table auth_user Creating

Re: Generic views & summary in the side bar

2010-06-10 Thread tsmets
If you connect to www.artima.com, there is on the right hand side a "Hottest Discussions" ... I could frame my page ... but I don't like that :( \T, On Jun 10, 12:16 pm, Venkatraman S wrote: > On Thu, Jun 10, 2010 at 3:32 PM, tsmets wrote: > > I thought I could use the ge

Generic views & summary in the side bar

2010-06-10 Thread tsmets
I thought I could use the generic views to fill the side bars with summary data. # urls.py latest_news_nbr = { "queryset" : News.objects.all().count(), } nbr_users = { "queryset" : PersonProfile.objects.count(), } Could some one tell me how I could have those being evaluated in a smart

Re: Help: Custom ManyRelatedManager Behavior

2010-06-09 Thread tsmets
I seem to hit a similar problem A News or Comment may have multiple Authors I would like the representation of the News / Comment to display the list of authors So I coded this : [code] def __unicode__(self): return self.title + " : " + self.txt [0:20] + ' ... (Authors : ' + show_authors

Re: Cannot authenticate ...

2010-02-01 Thread tsmets
Apparently, extending the "User" is not the right way (since 2006). I believe this seems to explain it all : http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-model/ \T, On Feb 1, 10:21 am, tsmets wrote: > well, > I think no, it is not the problem. >

Re: Cannot authenticate ...

2010-02-01 Thread tsmets
well, I think no, it is not the problem. The problem can be examplified like this : >>> username = 'tsmets' >>> pwd = '123456' # Is the user created in the console (when doing "synchdb") >>> user = authenticate(username=username,

Re: Cannot authenticate ...

2010-01-31 Thread tsmets
Forgot to add my source : _ models.py _ Testdata.py *** from django.db import models import logging from django.contrib.auth.models import User, UserManager log = logging.getLogger('dpaste.models') GENDER_

Cannot authenticate ...

2010-01-31 Thread tsmets
I create in my model the Authors class Author(User): """ An Author is someone more of less identified """ # TODO : Ensure that in fact the users are FK to the Django user management code gender = models.CharField(max_length=1, choices=GENDER_CHOICES) persistance = models.ForeignKey(Persis

Re: What is the uploaded file full path name

2010-01-12 Thread tsmets
This is ok if I did not want to use the possibility to upload to a directory containing the the date... If you read the specs : http://docs.djangoproject.com/en/1.1/ref/models/fields/#filefield I can speciify that the upload path is formatted with : DEFAULT_UPLOAD_SUBFOLDER = 'upload/%Y/%m/%d' T

What is the uploaded file full path name

2010-01-08 Thread tsmets
a ... Every thing goes fine but for the fact that I don't know the exact file name. tsm...@calvin:~/Documents/python/gramps/trunk/src/web/upload/ 2010/01/08$ ls -la total 20 drwxr-xr-x 2 tsmets tsmets 4096 2010-01-09 02:07 . drwxr-xr-x 3 tsmets tsmets 4096 2010-01-08 14:53 .. -rwxr-xr-x 1

Testing form posting

2009-03-28 Thread tsmets
I was wondering how I could test / unittest form posting ? class TestSomeRequest(TestCase): def testCallDefaultDpasteURL(self): response = self.client.get('/my_app/') self.failUnlessEqual(response.status_code, 200) def testCallDpasteAboutURL(self): postedData = { 'poster

Form & Paging

2009-02-26 Thread tsmets
I have a simple question over the best way I can paginate the result coming from parameters passed by a POST. In my current impelementation, I do the following : The Form "posts" the information to filter the data and the result is : "page one" of the query result. The resulting page generates a

Re: Apache2 + mod_python --> not working

2008-10-24 Thread tsmets
Forgot to add that I adapted the /etc/apache2/sites-available/default /// NameVirtualHost * ServerAdmin [EMAIL PROTECTED] PythonPath "['/home/me/Documents/django'] + sys.path" SetEnv DJANGO_SETTINGS_MODULE

Apache2 + mod_python --> not working

2008-10-24 Thread tsmets
I installed mod_python & apache2. mod_python is OK http://ubuntuforums.org/showthread.php?t=91101 I then a adapted the http.conf to [EMAIL PROTECTED]:/etc/apache2$ cat httpd.conf SetHandler python-program PythonHandler django.core.handler.modpython SetEnv DJANGO_SETTINGS_MODULES de_p

Re: Django events

2008-10-16 Thread tsmets
minor typo ... Site is htp://www.djangoproject.com without s \T, On Oct 16, 11:31 am, "Daniele Procida" <[EMAIL PROTECTED]> wrote: > On Thu, Oct 16, 2008, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > >> Is there a good single source of information about Django-related events > >> (training,

Re: displaying list from dictionnary -django 1.0

2008-10-06 Thread tsmets
eption Value: Could not parse the remainder: '()' from 'app_deployed_status_lst.items()' But if you remove the (), it seems to go further : {% for env, statuses in app_deployed_status_lst.items %} <-- Can be parsed \T, On Oct 3, 10:06 pm, "David Durham,

displaying list from dictionnary -django 1.0

2008-10-03 Thread tsmets
I have an application that records the status of an applications. Basically something like : _ started-request _ started _ stop-requested _ stopped + some technical informations (version, host, URL, ...) I thought having a page that display per environment : dev, test, acceptance, prod the s

Extra space in the match string

2008-09-24 Thread tsmets
I am refactoring my URL matching configuration file and I get this : [snip] Page not found (404) Request Method: GET Request URL:http://localhost:8000/followDeploys/viewDeployed/xxx Using the URLconf defined in customer.urls, Django tried these URL patterns, in this order: 1. ^fol

Re: Model/admin page problem

2008-09-22 Thread tsmets
Correct I, of course, added after synching and it looked everything was fine Tx, \T, On Sep 22, 3:29 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Mon, Sep 22, 2008 at 9:10 AM, tsmets <[EMAIL PROTECTED]> wrote: > > I am running 1.0 on sqlite3

Re: Model/admin page problem

2008-09-22 Thread tsmets
lib-tk', 'C:\\Python25\ \lib\\site-packages'] Server time:Mon, 22 Sep 2008 14:57:53 +0200 [/snip] This seems consistent with the logs C:\Projects\tools\django_test>python manage.py syncdb Creating table auth_permission Creating table auth_group Creating table auth_user Creatin

Re: DJANGO 1.0 : How to avoid converting to entities

2008-09-20 Thread tsmets
OK ! I found it : http://code.djangoproject.com/wiki/AutoEscaping {% autoescape off %} {{ body }} {% endautoescape %} \T, ps : It seems I did not find it in the django book either --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

DJANGO 1.0 : How to avoid converting to entities

2008-09-20 Thread tsmets
I am writting a home brewed version of http://dpaste.com I manage to convert/colorize most the code with pygment. However when I print the content of the "colorized" code in the function, I have the correct html code as colorized by pygment. Then I do : [code] return render_to_response('dpas