Re: Success at using "reusable apps"?

2009-08-16 Thread Andy McKay
On 16-Aug-09, at 8:50 PM, Margie Roginski wrote: > * modify the threadedcomments views.py code to take a callback > function as an argument - that callback function could do my Task > specific stuff as described above, but this would keep it more > encapsulated within my Task app (but of course

are model field choices enumerated in the db?

2009-08-16 Thread cerberos
when the choices attribure is used for a model field are the choices enumerated in the database? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Django-tinymce and filebrowser, error.

2009-08-16 Thread tdelam
Hey, I built a web site locally, I am using django-tinyce and the django- filebrowser, it works no problem on my local machine. As soon as I deploy it to the server I have a problem. The TinyMCE is showing up and working fine but when I click inside the image popup window to add an image, I get

Re: Problem with getting setting up apache server for django

2009-08-16 Thread NiJoMi
Done a reinstall and checked each step. --- Step 1: Installed WampServer2 and verified working Location: C:\imfree Components of WampServer 2.0i [11/07/09] Apache 2.2.11 MySQL 5.1.36 PHP 5.3.0

Re: Possible to use Django & MySQL with Python 2.6?

2009-08-16 Thread Alex Gaynor
On Sun, Aug 16, 2009 at 11:32 PM, Continuation wrote: > > According to the site of the python MySQL driver it only supports > Python 2.3 - 2.5: > http://sourceforge.net/projects/mysql-python/ > > So is it possible to use Django & MySQL with Python 2.6? Is there any >

Possible to use Django & MySQL with Python 2.6?

2009-08-16 Thread Continuation
According to the site of the python MySQL driver it only supports Python 2.3 - 2.5: http://sourceforge.net/projects/mysql-python/ So is it possible to use Django & MySQL with Python 2.6? Is there any workaround I can do to make it work? --~--~-~--~~~---~--~~ You

Success at using "reusable apps"?

2009-08-16 Thread Margie Roginski
I have a general question about how people manage "reusable apps" in the web app world. Let me give an example of what I am encountering, maybe those of you with experience can comment. I'm developing an app that is a task management app. IE, an engineering manger creates tasks, spawns them

Re: misunderstanding

2009-08-16 Thread Mike Dewhirst
Karen and Eric - thank you. Yet another door opened for me :) Mike Karen Tracey wrote: > On Sun, Aug 16, 2009 at 9:33 PM, Mike Dewhirst > Based on what your template does, you don't seem to really want to > combine a dictionary with the key 'title' and the META

aggregate(Sum('x')) returns None

2009-08-16 Thread kesmit
I've noticed that the Sum('x') function will return None if there are no records in the queryset. This doesn't seem correct to me. Shouldn't Sum always return a Decimal? It makes it difficult to compute more complex expressions when you can't depend on a number being returned.

Re: Class Meta discovery

2009-08-16 Thread James Bennett
On Sun, Aug 16, 2009 at 10:14 PM, aa56280 wrote: > Not sure how well known this is but I thought I'd share seeing as how > it cost me a lot of time and I can't find any discussion of it: This is a well-known aspect of Python which is usually covered by any good introductory

Class Meta discovery

2009-08-16 Thread aa56280
Not sure how well known this is but I thought I'd share seeing as how it cost me a lot of time and I can't find any discussion of it: I have a form for a model. The model has three fields, but I only want one displayed in the form. So I do this: class NoteForm(ModelForm): class Meta:

Re: misunderstanding

2009-08-16 Thread Karen Tracey
On Sun, Aug 16, 2009 at 9:33 PM, Mike Dewhirst wrote: > > There's something here I'm not seeing. If anyone can point out the docco > which refers I would be most grateful ... I'm using py2.6 and Django > from svn head. > > The template below displays the title correctly but

Re: misunderstanding

2009-08-16 Thread Eric Abrahamsen
On Aug 17, 2009, at 9:33 AM, Mike Dewhirst wrote: > > There's something here I'm not seeing. If anyone can point out the > docco > which refers I would be most grateful ... I'm using py2.6 and Django > from svn head. > > The template below displays the title correctly but claims "No meta >

misunderstanding

2009-08-16 Thread Mike Dewhirst
There's something here I'm not seeing. If anyone can point out the docco which refers I would be most grateful ... I'm using py2.6 and Django from svn head. The template below displays the title correctly but claims "No meta dictionary passed". Since the title is one of the meta_dict

Re: Setting tzinfo for DateTimeFields with Postgresql - workaround

2009-08-16 Thread Ramiro Morales
Hi George, On Thu, May 21, 2009 at 7:56 PM, George Song wrote: > > Hi Glenn, > > When you get the chance can you review my proposal[1] for fixing > DateTimeField in Django? > > I'm going to try to get this in for 1.2 release. > > [1] http://code.djangoproject.com/ticket/10587

Re: QuerySet's cache

2009-08-16 Thread David
Ah, ok that makes more sense now. Thank you! On Aug 16, 5:52 pm, Alex Gaynor wrote: > On Sun, Aug 16, 2009 at 8:42 AM, David wrote: > > > Hi all, > > > I'm a bit puzzled by the caching behaviour of QuerySets, when used in > > iteration and when

Re: Anybody?? uber-newb question... installing django

2009-08-16 Thread jzacsh
Thanks a bunch! :) __ Jonathan Zacsh www.jzacsh.com via mobile phone -Original Message- From: Wayne Koorts Date: Mon, 17 Aug 2009 11:06:50 To: Subject: Re: Anybody?? uber-newb question... installing django Hi Jon, The "python

Re: Anybody?? uber-newb question... installing django

2009-08-16 Thread Wayne Koorts
Hi Jon, The "python setup.py install" command copies the Django library files to your Python's lib\site-packages directory. You can safely remove the Django archive which you downloaded. Regards, Wayne 2009/8/17 Jonathan Zacsh : > > please, can anyone help me out?? > -- >

Re: Anybody?? uber-newb question... installing django

2009-08-16 Thread Jonathan Zacsh
please, can anyone help me out?? -- Jon On Sun, Aug 16, 2009 at 10:20 AM, jzacsh wrote: > hello, > > i'm sorry - i just want to get started and I'm trying to figure out > something simple. I installed django last night and am wondering what > setup.py actually did. > > the

Django and MySQL 5.4

2009-08-16 Thread Thiago511
Are they compatible? Django official website tells me to get the MySQLdb from djangoproject.com/r/python-mysql I tried installing it but it says that I need Python 2.5.I have 2.6 what SQL servers would you guys recommend? I need a secure one like Open SSL

Re: Django and stackless python

2009-08-16 Thread Graham Dumpleton
On Aug 16, 10:43 pm, zayatzz wrote: > apparently installing mod_wsgi was not the instant get out of trouble > card. > > For a while i had problem with mod_wsgi settings. Now the trouble with > modules continues. I think i must somehow finally fix all the paths. > >

Display Tables

2009-08-16 Thread haftish21
I'm new to django, my first time 2 use it. I read this in the Writing your first Django app, part 1 document >>> If you're interested, run the command-line client for your database and >>> type \dt (PostgreSQL), SHOW TABLES; (MySQL), or .schema (SQLite) to display >>> the tables Django

Re: Render template tags together

2009-08-16 Thread Doug B
I don't know if it's the best approach or not, but what I've done in the past is to have the first call to the tag do any expensive stuff and store it in a dict under a special name in the context (I usually use __tagname). Subsequent calls to the tag use the data from the context variable

Render template tags together

2009-08-16 Thread Jonas Obrist
hi django-users I try to improve the performance of my web app and one of the things I want to do is render all occurrences of a certain tag at once instead of each on its own. The reason is simple: Each template tag loops over a series of regex pattern out of a database which it has to

Re: 3 questions about DecimalFields

2009-08-16 Thread bobhaugen
Karen, Once again, thanks for the detailed and useful response. On Aug 16, 1:17 pm, Karen Tracey wrote: > If the Python object was created on the fly and relied on the default value: > > dt1 = DThing() > dt1.save() > Then prior to the fix for that bug, dt1.remaining and

Re: Unicode Text for Dictionary Keys ok for Templates?

2009-08-16 Thread Karen Tracey
On Sun, Aug 16, 2009 at 1:28 PM, rmschne wrote: > > I'm extracting data from a database and then cross-tabbing the data > (with some Python) code to create a list of dictionary data. Because > the key names are derived from data in the database, and the database > is composed

send_mail function

2009-08-16 Thread ramanathan
HI In the message field i tried to include a link using href. send_mail("subject"," Click here ", 'a...@yahoo.co.in', ['a...@gmail.com'] ) But it is not working. How to include a link in the message field of send_mail function? Thanks & regards, Ramanathan M

Re: 3 questions about DecimalFields

2009-08-16 Thread Karen Tracey
On Sun, Aug 16, 2009 at 12:24 PM, bobhaugen wrote: > > 1, I ran into this anomaly in updating a decimal field: > > The field: > >remaining = models.DecimalField(max_digits=8, decimal_places=2, > default=Decimal("0")) > > The code that failed: > > 658

Re: carrying value from ForeignKey

2009-08-16 Thread kmike
I mean smth. like lambda: self.content.text On 16 авг, 20:41, Ali Rıza Keleş wrote: > Hello, > > I want to carry value as default from one model to another. > > For example: > > class Text(models.Model): >     text = models.TextField(blank = True) >     name =

Re: carrying value from ForeignKey

2009-08-16 Thread kmike
You can override `save` method or maybe provide callable ***, smth. like default=lambda: self.text but i haven't test it. On 16 авг, 20:41, Ali Rıza Keleş wrote: > Hello, > > I want to carry value as default from one model to another. > > For example: > > class

Unicode Text for Dictionary Keys ok for Templates?

2009-08-16 Thread rmschne
I'm extracting data from a database and then cross-tabbing the data (with some Python) code to create a list of dictionary data. Because the key names are derived from data in the database, and the database is composed of unicode text, the keys are unicode, e.g. here are three records in the

Re: 3 questions about DecimalFields

2009-08-16 Thread bobhaugen
On Aug 16, 11:24 am, bobhaugen wrote: > 2. This changeset says it has fixed ticket > #5903:http://code.djangoproject.com/changeset/9823 > > Also says it was fixed 6 months ago.  I did not find the ticket listed > in any of the milestones in the last 6 months, and the page

Re: QuerySet's cache

2009-08-16 Thread Alex Gaynor
On Sun, Aug 16, 2009 at 8:42 AM, David wrote: > > Hi all, > > I'm a bit puzzled by the caching behaviour of QuerySets, when used in > iteration and when called with repr(). According to the documentation, > when a QuerySet is evaluated for the first time, the results

3 questions about DecimalFields

2009-08-16 Thread bobhaugen
1, I ran into this anomaly in updating a decimal field: The field: remaining = models.DecimalField(max_digits=8, decimal_places=2, default=Decimal("0")) The code that failed: 658 self.remaining -= qty 659 self.remaining = max([Decimal("0"), self.remaining]) 660

carrying value from ForeignKey

2009-08-16 Thread Ali Rıza Keleş
Hello, I want to carry value as default from one model to another. For example: class Text(models.Model): text = models.TextField(blank = True) name = models.SlugField(db_index=True, unique=True) class News(models.Model): content = models.ForeignKey(Text, blank = True, null =

uber-newb question... installing django

2009-08-16 Thread jzacsh
hello, i'm sorry - i just want to get started and I'm trying to figure out something simple. I installed django last night and am wondering what setup.py actually did. the reason i want to know is: what do i do with the folder of stuff that I downloaded from the original tar.gz (I get the

QuerySet's cache

2009-08-16 Thread David
Hi all, I'm a bit puzzled by the caching behaviour of QuerySets, when used in iteration and when called with repr(). According to the documentation, when a QuerySet is evaluated for the first time, the results are cached. Trying this out in the shell, this works as expected for iteration.

how do you display custom permissions on admin site?

2009-08-16 Thread sam lee
Hi, I have the following model; class MyModel(models.Model): class Meta: permissions = (('test_perm', 'a test permission'),) I run syncdb and runserver Then I go to /admin/auth/user/1/ But I don't see the myapp | test_perm listed under Permissions field. Do I need to do some

something wrong with extra_context

2009-08-16 Thread iXh
i do my site, there is something wrong with extra_context i define the url processer in urls.py follow as: url(r'^$', 'simple.direct_to_template', kwargs={'template': 'index.html','extra_context': {'item_list': lambda: Item.objects.all()}},name = 'index'), and in my template , when

Re: Django and stackless python

2009-08-16 Thread zayatzz
apparently installing mod_wsgi was not the instant get out of trouble card. For a while i had problem with mod_wsgi settings. Now the trouble with modules continues. I think i must somehow finally fix all the paths. current error is : [Sun Aug 16 12:38:22 2009] [error] [client 127.0.0.1]

Re: with statements

2009-08-16 Thread GuyBowden
Alex, It's a Tag, so will give the filter route a go - shouldn't take too much to swap it over.. at the moment this is the only place I'm using the tag/filter.. Guy On Aug 16, 1:37 pm, Alexander Dutton wrote: > On 16/08/09 09:50, GuyBowden wrote: > > > > > Hi All, > > >

Re: Django and stackless python

2009-08-16 Thread zayatzz
z...@zayatzz:/var/log/apache2$ ls -las /usr/local/lib/python2.6/site- packages total 27 0 drwxrwsr-x 3 root staff 144 2009-08-16 12:09 . 19 drwxrwsr-x 26 root staff 19392 2009-08-16 10:54 .. 1 drwxr-sr-x 17 root staff 496 2009-08-16 12:09 django 4 -rw-r--r-- 1 root staff 947 2009-08-16

Re: with statements

2009-08-16 Thread Alexander Dutton
On 16/08/09 09:50, GuyBowden wrote: > Hi All, > > Just wondering what the best way to do this sort of thing is: > > {% with last_tweet_sent this_user as sent_at %} > {{ sent_at|naturalday:_("MONTH_DAY_FORMAT")|capfirst}} > {% endwith %} > > I've got a function "last_tweet_sent" in a

Re: Django and stackless python

2009-08-16 Thread Graham Dumpleton
On Aug 16, 9:24 pm, zayatzz wrote: > I did reinstall mod_python indeed. Then you can't have installed it for that version of Python. Did you use the --with-python option to 'configure' for mod_python to tell it to use your alternate Python installation? That or the

Re: Django and stackless python

2009-08-16 Thread zayatzz
I did reinstall mod_python indeed. when i do import mod_python then : >>> import mod_python Traceback (most recent call last): File "", line 1, in ImportError: No module named mod_python >>> so nope :( Alan On Aug 16, 2:01 pm, Graham Dumpleton wrote: >

Re: How to get DATABASE_NAME

2009-08-16 Thread Alexander Dutton
On 16/08/09 09:38, Maksymus007 wrote: > On Sun, Aug 16, 2009 at 10:30 AM, adelaide_mike > wrote: >> In my reporting function I need to have: >> >> If DATABASE_NAME = x: >>#do this >> Else: >>#do the other >> >> How can I obtain that name, which is established

Re: passing parameters in every view...

2009-08-16 Thread Mike Ramirez
On Sunday 16 August 2009 03:34:16 am Mirat Bayrak wrote: > Hi i am working on a website and i am passing *request.user* and a > *region*object to every template by manually in my every view. Can i > do it by using > some other method? i mean i dont want to pass them in every view can django > do

Re: Django and stackless python

2009-08-16 Thread Graham Dumpleton
Did you actually bother to reinstall mod_python after you nuked your original Python installation. Likely when reinstalling it you lost everything that was in prior site-packages and so are missing the Python module component bits of mod_python, ie., no longer installed. If from command line

Re: i need your ideas

2009-08-16 Thread Mike Ramirez
On Sunday 16 August 2009 03:44:07 am Mirat Bayrak wrote: > Hi, i am working on a website, to explain it basically i can say that it's > works like twitter but every entry should have confirmed by admins. at that > point i am little confused, should i write that confirmation screens on > admin page

Re: Django and stackless python

2009-08-16 Thread zayatzz
i begun to think about the same thing when i went through the log. Couldnt find anything useful why mod_python is failing atm, so i anyone can think of why this is not working - i still could use your help. Otherwise since it has nothing to do with django, i'll try to get help though

i need your ideas

2009-08-16 Thread Mirat Bayrak
Hi, i am working on a website, to explain it basically i can say that it's works like twitter but every entry should have confirmed by admins. at that point i am little confused, should i write that confirmation screens on admin page or should i write a complatelyn new page? becouse i dont know

passing parameters in every view...

2009-08-16 Thread Mirat Bayrak
Hi i am working on a website and i am passing *request.user* and a *region*object to every template by manually in my every view. Can i do it by using some other method? i mean i dont want to pass them in every view can django do it automatically?

Re: Master / Slave Database Replication Scenario

2009-08-16 Thread Matthias Kestenholz
On Sun, Aug 16, 2009 at 11:44 AM, Haes wrote: > > Hi, > > we are using master / slave database replication, no partitioning, > just replicating the complete database to several slaves for > performance reasons. This is making some problems with a newly > developed Django

Re: Master / Slave Database Replication Scenario

2009-08-16 Thread Austin Gabel
Off the top of my head a couple of ideas come to mind. A quick and dirty way would be to have a separate Django project that only handles the admin app. Another way would be to make a custom model manager that would select the database to use. This way is a little more involved but not

Re: Django and stackless python

2009-08-16 Thread Austin Gabel
It looks like the issue is occurring when Apache tries to load mod_python. This doesn't have anything to do with Django at this point. You may need to do a bit more research on how Stackless Python works with Apache and mod_python. On Sun, Aug 16, 2009 at 5:04 AM, zayatzz

Re: Django and stackless python

2009-08-16 Thread Austin Gabel
Can you post your error log? On Sun, Aug 16, 2009 at 4:12 AM, zayatzz wrote: > > Hello > > I installed stackless pyton 2.6.2 after reading several sites that > said its fully compatible with vanilla python. After installing i > found that my django applications do

Master / Slave Database Replication Scenario

2009-08-16 Thread Haes
Hi, we are using master / slave database replication, no partitioning, just replicating the complete database to several slaves for performance reasons. This is making some problems with a newly developed Django project, which makes use of an existing database. Is there an (easy) way to use a

Re: Django and stackless python

2009-08-16 Thread zayatzz
apache error log shows such stuff: http://dpaste.com/81241/ Alan. On Aug 16, 12:12 pm, zayatzz wrote: > Hello > > I installed stackless pyton 2.6.2 after reading several sites that > said its fully compatible with vanilla python. After installing i > found that my

Django and stackless python

2009-08-16 Thread zayatzz
Hello I installed stackless pyton 2.6.2 after reading several sites that said its fully compatible with vanilla python. After installing i found that my django applications do not work any more. I did reinstall django (1.1) again and now im kind of lost. The error that i get is 500: Internal

Re: Django Is telling me table already exists on syncdb - can’t figure out why

2009-08-16 Thread Alvin
django-mptt was the culprit renamed table for memorial_music to memorial_music_library and everything went smooth thank you django for manage.py sqlall memorial On Aug 16, 4:43 am, Alvin wrote: > Posted the model athttp://pastebin.com/f609771cc > > getting error: (yes

with statements

2009-08-16 Thread GuyBowden
Hi All, Just wondering what the best way to do this sort of thing is: {% with last_tweet_sent this_user as sent_at %} {{ sent_at|naturalday:_("MONTH_DAY_FORMAT")|capfirst}} {% endwith %} I've got a function "last_tweet_sent" in a templatetags module that takes a user and spits back the

Re: Django Is telling me table already exists on syncdb - can’t figure out why

2009-08-16 Thread Alvin
forgot to mention: before running syncdb I delete all memorial_ tables... hoping someone can offer some advice on this one On Aug 16, 4:43 am, Alvin wrote: > Posted the model athttp://pastebin.com/f609771cc > > getting error: (yes it's windows) File

Django Is telling me table already exists on syncdb - can’t figure out why

2009-08-16 Thread Alvin
Posted the model at http://pastebin.com/f609771cc getting error: (yes it's windows) File "C:\Python25\lib\site-packages \MySQLdb\connections.py", line 35, in defaulterrorhandler raise errorclass, errorvalue _mysql_exceptions.OperationalError: (1050, "Table 'memorial_music' already exists")

Re: How to get DATABASE_NAME

2009-08-16 Thread Maksymus007
import myproject.settings; if settings.DATABASE_NAME = x: On Sun, Aug 16, 2009 at 10:30 AM, adelaide_mike wrote: > > In my reporting function I need to have: > > If DATABASE_NAME = x: >    #do this > Else: >    #do the other > > How can I obtain that name, which is

How to get DATABASE_NAME

2009-08-16 Thread adelaide_mike
In my reporting function I need to have: If DATABASE_NAME = x: #do this Else: #do the other How can I obtain that name, which is established in settings.py? Mike --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

DecimalField's and lots of math

2009-08-16 Thread John M
I'm wondering how people deal with the DecimalField in django? I've just discovered the amount of typecasting I have to do to work with this field, example: field1 = models.DecimalField(...) you can't do : y = field1 / 100.0 you have to do y = field1 / Decimal(100) But then you can't do

Re: easy way of display an user bar?

2009-08-16 Thread Mirat Bayrak
I have that problem too, is there any other solution? --~--~-~--~~~---~--~~ 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: Django in Vista

2009-08-16 Thread Thiago511
Sam. YOU ARE A LIFE SAVER! while writing down the Path thing for you, I noticed my problema simple spelling error. here it is: before I started my path I forgot to but a semicolon. so my path was this: Previous path\C:\Python26\Scripts INSTEAD OF: Previous Path\; C:\Python26\Scripts

Re: Django in Vista

2009-08-16 Thread Sam Lai
You added the directory containing django-admin.py to your PATH right, not the path of django-admin.py itself? If you want, type 'set path' (without quotes) into your command prompt and paste the result here and we'll see if you did it right. 2009/8/16 Thiago511 : > >