Best practice for storing custom admin templates?

2008-01-25 Thread Julien
Hi all! I'm making an app which has some custom views to extend the admin back end. So I've also made some templates which are stored in "admin/ myapp/" in my project template folder. I've made that app generic, so now I'd like to take everything out of my project, including the admin

win free dollors with out hard working and with out wait

2008-01-25 Thread robina malik
http://pickthedollors.blogspot.com open the site and get free dollors without any hardworking and without wait just open it and find a form in this site behind web links on this site and get free dollrs and bank account --~--~-~--~~~---~--~~ You received this

Re: Naughty word filter

2008-01-25 Thread Jeff Anderson
I have also written a patch for django to include a profanity template filter. It replaces words with asterisks or random symbols. http://code.djangoproject.com/ticket/6290 globophobe wrote: I'm preparing my site for general consumption and would prefer that naughty words not be presented in

Decimal & float operation errors

2008-01-25 Thread [EMAIL PROTECTED]
I have a model with a decimal field. When accessing that field, it is showing up as a float which seemed wrong. It was causing errors where += wasn't defined for floats & decimals. The problem turned out to be that I initialized the decimal values to 0.0, not Decimal("0.0"). This was on the

Re: newforms and updating

2008-01-25 Thread Vance Dubberly
ah so the idea is to us a url something like this for form /module/item_id/edit and save to /module/item_id/save feels queer but i'll try and get used to it. thanks i guess i couldn't get my head outa the rut.. Vance On Jan 25, 2008 7:07 PM, Brian Rosner <[EMAIL PROTECTED]> wrote: > >

Re: syncdb and postgres problems

2008-01-25 Thread Jeremy Dunck
On Jan 25, 2008 11:55 AM, Martin Ostrovsky <[EMAIL PROTECTED]> wrote: > > I'm trying to run syncdb on a clean database (no other tables etc.) in > postgres. It produces the standard Postgres error: ... > I know there's nothing wrong with my settings file and/or models code > because I'm just

Re: Naughty word filter

2008-01-25 Thread globophobe
On Jan 26, 2:29 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > Django comes with a naughty-word filter/validator, > hasNoProfanities.  Just set the PROFANITIES_LIST in your > settings.py to be the list of words you don't want to include.  I > believe there's already a modest default list detailed in

Re: Naughty word filter

2008-01-25 Thread Tim Chase
> I'm preparing my site for general consumption and would prefer that > naughty words not be presented in usernames or on public pages. Is > there a recommended way of filtering out the uncouth? Django comes with a naughty-word filter/validator, hasNoProfanities. Just set the PROFANITIES_LIST

Naughty word filter

2008-01-25 Thread globophobe
I'm preparing my site for general consumption and would prefer that naughty words not be presented in usernames or on public pages. Is there a recommended way of filtering out the uncouth? --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: dynamic model calls

2008-01-25 Thread Russell Keith-Magee
On Jan 26, 2008 8:11 AM, Chris <[EMAIL PROTECTED]> wrote: > > Hello, > > I am seeking to do something like this: > > def dynamic_model_call(model_name): > test = model_name.objects.all() > return test > This will work fine as long as you pass an actual model into the method: >>>

Re: Django multilingual

2008-01-25 Thread Russell Keith-Magee
On Jan 26, 2008 6:03 AM, Piotr Majewski <[EMAIL PROTECTED]> wrote: > > I would love to have the (native) feature that django-multilingual > gives. For me an many developers i know this is vital. Is it any way > that django 1.0 will support multilingual models (content) ? Hi Piotr, Unlikely. The

Re: newforms and updating

2008-01-25 Thread Brian Rosner
On 2008-01-25 19:18:22 -0700, "Vance Dubberly" <[EMAIL PROTECTED]> said: > > ok so this ones got to be really simple and I've go to be really stupid. > > I want to update a model of something I already have in the database > so I made a ModelForm that doesn't do anything special for it and I >

newforms and updating

2008-01-25 Thread Vance Dubberly
ok so this ones got to be really simple and I've go to be really stupid. I want to update a model of something I already have in the database so I made a ModelForm that doesn't do anything special for it and I use that form to generate a form in a template using the normal form.as_table method.

Re: custom managers and FOO_set

2008-01-25 Thread Eric Abrahamsen
> Try changing that to: > entries = self.filter(dispDate__lte=now).filter(isOpen=True) Perfect, thanks a lot Rajesh. I guess I hadn't picked up that the super() call was only being used when extending the original get_query_set() method. Eric

Re: admin page seg faults

2008-01-25 Thread Heather
Thanks - I'll check that out. On Jan 20, 3:41 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > The mod_wsgi package gets affected by a lot of similar issues to > mod_python. The documentation for mod_wsgi covers various shared > library and name space conflicts including that of MySQL, PHP etc

Re: admin page seg faults

2008-01-25 Thread Heather
Thanks - I'll check that out. On Jan 20, 3:41 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > The mod_wsgi package gets affected by a lot of similar issues to > mod_python. The documentation for mod_wsgi covers various shared > library and name space conflicts including that of MySQL, PHP etc

Re: pdf/Firefox and turning off GZipMiddleware

2008-01-25 Thread Ned Batchelder
We just ran into this problem also. It's reported in ticket 6027: http://code.djangoproject.com/ticket/6027 GzipMiddleware and responses with files for content (rather than strings) don't get along... --Ned. [EMAIL PROTECTED] wrote: > I've been tearing my hair out for a little while trying

Re: Time zone issues

2008-01-25 Thread patibulaire
I am on the gridserver as well.Did you try America/Los_Angeles. I live in Barcelona , so, for me I set it to Europe/Madrid. And it works. Hope this helps. Patrick On Jan 25, 10:49 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm on MediaTemple's new gridserver for Django and I can't

Re: *Occasional* PostgreSQL Error

2008-01-25 Thread Jacob Kaplan-Moss
Hi Doug -- On 1/24/08, Doug Van Horn <[EMAIL PROTECTED]> wrote: > OperationalError: could not connect to server: No such file or > directory >Is the server running locally and accepting >connections on Unix domain socket "/var/run/postgresql/.s.PGSQL. > 5432"? This means that,

dynamic model calls

2008-01-25 Thread Chris
Hello, I am seeking to do something like this: def dynamic_model_call(model_name): test = model_name.objects.all() return test I saw where I could do something like this: def dynamic_model_call(model_name): exec("test = %s.objects.all()" % model_name) return test But this

Time zone issues

2008-01-25 Thread [EMAIL PROTECTED]
I'm on MediaTemple's new gridserver for Django and I can't seem to get the time to be set correctly. I'm in the PST timezone, but when Iset it to any of the options I thought should work (Etc/GMT+8 for example) it still posts all my comments as 8 hours ahead of the actual time. Has anyone had a

Django multilingual

2008-01-25 Thread Piotr Majewski
I would love to have the (native) feature that django-multilingual gives. For me an many developers i know this is vital. Is it any way that django 1.0 will support multilingual models (content) ? --~--~-~--~~~---~--~~ You received this message because you are

pdf/Firefox and turning off GZipMiddleware

2008-01-25 Thread [EMAIL PROTECTED]
I've been tearing my hair out for a little while trying to figure out why I can't display pdfs from Django in Firefox. I'm getting blank windows and I know it used to work ;-) I'm using the code from the documentation (http:// www.djangoproject.com/documentation/outputting_pdf/), removing

Re: category counter

2008-01-25 Thread Chris
Cool. I tried that early and it didn't work. I just tried it again and it seems to work. must of keyed something in wrong. >>> Weblog.objects.filter(category__id='1').count() 3L Thanks for your help. On Jan 25, 2:08 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > On Jan 25, 2:01 pm, Chris

Re: Manipulating my 1-N's parent object's properties

2008-01-25 Thread John M
Thanks, I'll try the print statements. This is my first pass at the save() routine, and your idea is good, although I may try other methods. Thanks for the help. John On Jan 25, 11:01 am, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > On Jan 25, 1:39 pm, John M <[EMAIL PROTECTED]> wrote: > > >

Re: Manipulating my 1-N's parent object's properties

2008-01-25 Thread Rajesh Dhawan
On Jan 25, 1:39 pm, John M <[EMAIL PROTECTED]> wrote: > Well, it is in my file, and I can thank Windows for the bad paste :). Ah.. > Assume the indenting is right, any other thoughts? How are you saving the Trade object when you say it doesn't work? Is that through the Admin or through your

Re: category counter

2008-01-25 Thread Rajesh Dhawan
On Jan 25, 2:01 pm, Chris <[EMAIL PROTECTED]> wrote: > Cool here is my models and I posted an sql query to: > > Modelshttp://dpaste.com/32548/ > > SQL Queries (posted a question in this one)http://dpaste.com/32552/ > > Hope this helps. maybe there is a better way of doing what I am trying > to

Re: category counter

2008-01-25 Thread Chris
Cool here is my models and I posted an sql query to: Models http://dpaste.com/32548/ SQL Queries (posted a question in this one) http://dpaste.com/32552/ Hope this helps. maybe there is a better way of doing what I am trying to do. Thanks for helping. On Jan 25, 12:59 pm, Rajesh Dhawan

Re: Manipulating my 1-N's parent object's properties

2008-01-25 Thread John M
Well, it is in my file, and I can thank Windows for the bad paste :). Assume the indenting is right, any other thoughts? John On Jan 25, 10:29 am, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > On Jan 25, 1:21 pm, John M <[EMAIL PROTECTED]> wrote: > > > I have a OneToMany Model where in the save()

Re: Manipulating my 1-N's parent object's properties

2008-01-25 Thread Rajesh Dhawan
On Jan 25, 1:21 pm, John M <[EMAIL PROTECTED]> wrote: > I have a OneToMany Model where in the save() routine of the Many class > I try to manipulate a set of fields of the owner of my record.  See my > dpaste examplehttp://dpaste.com/hold/32545/ You've got an indentation problem on line 64

Re: Image upload error

2008-01-25 Thread Rajesh Dhawan
On Jan 25, 12:55 pm, todd <[EMAIL PROTECTED]> wrote: > class Image(models.Model): >     image = models.ImageField(upload_to='/PATH/site/files', > blank=True, unique=True) I would suggest renaming the class Image to something else because the Python Imaging Library provides a class by that same

Connect to MySQL using a password

2008-01-25 Thread Greig Rapley
Hi, I have been connecting Django to MySQL using a DATABASE_USER='root' and DATABASE_PASSWORD='' (those are single quotes - empty string) until today. It all worked fine. Today I try to lock down my database by adding a password to the root user. So I type; $ mysqladmin -u root password

Re: category counter

2008-01-25 Thread Rajesh Dhawan
On Jan 25, 12:42 pm, Chris <[EMAIL PROTECTED]> wrote: > Thanks for reply but that is not what I am looking to do. my [EMAIL > PROTECTED] table > is NOT the categories table. Well, as I said in my earlier post, you still haven't posted your model code. It would help people understand better

Re: Image upload error

2008-01-25 Thread todd
class Image(models.Model): image = models.ImageField(upload_to='/PATH/site/files', blank=True, unique=True) class Admin: pass def __str__(self): return self.image class Client(models.Model): name = models.CharField(maxlength=255) street =

syncdb and postgres problems

2008-01-25 Thread Martin Ostrovsky
I'm trying to run syncdb on a clean database (no other tables etc.) in postgres. It produces the standard Postgres error: psycopg2.ProgrammingError: current transaction is aborted, commands ignored until end of transaction block Digging a bit deeper, I see the exception is thrown in

Re: category counter

2008-01-25 Thread Chris
Thanks for reply but that is not what I am looking to do. my [EMAIL PROTECTED] table is NOT the categories table. In django, when it generates your models, it automatically generates your M2M table reference. so I have a table called blog that has a m2m relation with categories. (blog-->M2M--

Re: Image upload error

2008-01-25 Thread Rajesh Dhawan
Hi, > Has anyone got any clues what's happening? You need to post your model code so people can help you find the problem. -Rajesh D --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Model: field for HTML

2008-01-25 Thread Michael Hipp
Rajesh Dhawan wrote: > > > On Jan 25, 11:57 am, Michael Hipp <[EMAIL PROTECTED]> wrote: >> When creating a field that will hold HTML snippets, should it be created >> as a CharField or an XMLField (or something else)? > > Either of those would work. The XMLField would require you to >

Re: confusion over custom template tags

2008-01-25 Thread Rajesh Dhawan
On Jan 24, 10:36 pm, hifire <[EMAIL PROTECTED]> wrote: > Greetings group! > > I've been trying to get this code to > work:http://www.djangosnippets.org/snippets/282/ > > I created a templatetags folder in my app, and added __init__.py and > usertags.py. I pasted the code from the snippets site

Re: Model: field for HTML

2008-01-25 Thread Rajesh Dhawan
On Jan 25, 11:57 am, Michael Hipp <[EMAIL PROTECTED]> wrote: > When creating a field that will hold HTML snippets, should it be created > as a CharField or an XMLField (or something else)? Either of those would work. The XMLField would require you to guarantee that the HTML snippet is valid

Re: category counter

2008-01-25 Thread Rajesh Dhawan
>  so if category_id 2 name is 'politics' it would know that it occurs 3 > times. make sense?  The easy way would be to create a counter field in > the categories table and count each time that the category is being > used but that is redundant and require extra work to save the category > count

Image upload error

2008-01-25 Thread todd
Hi Django users, I'm new to Django but have manage to build my model and db, all goes well, till... I've been trying to upload images, and this goes well enough if in a table the image has it's own column, but I'd like to re-use images, so first I tried to making an images table and doing a

Model: field for HTML

2008-01-25 Thread Michael Hipp
When creating a field that will hold HTML snippets, should it be created as a CharField or an XMLField (or something else)? Thanks, Michael --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: category counter

2008-01-25 Thread Chris
Thanks for the response. If only it were that easy :). In my categories table, each category should be unique. What I am trying to count is the m2m ref table. Example. category_id | name 1 | programming 2 | politics 3 | games blog_id | category_id 1 | 2 <-- I am trying to reference this table

Re: custom managers and FOO_set

2008-01-25 Thread Rajesh Dhawan
On Jan 24, 9:54 pm, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > > Can you include the code for your CustomManager.open() method? > > class OpenEntries(models.Manager): > def open(self): > now = datetime.now() > entries = super(OpenEntries, >

free online job:

2008-01-25 Thread see
free online job: enjoy work on this job and ...very use full work details http://asiafriendfinder.com/go/g933052 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Seeking design advice: Passing url names to a template

2008-01-25 Thread Julien
Hello there! I'm seeking some design advice, and I hope you'll have some suggestions :) I'm storing my site's menu structure into the database so that I can edit it from the admin. Here's the code: class MenuItem(models.Model): caption = models.CharField(max_length=30) url =

Re: category counter

2008-01-25 Thread Thomas Guettler
Hi, There are two ways of counting: # Bad way: len(MyModel.objects.filter(...)) This will fetch all rows (SELECT * FROM ... WHERE ...;) # Good way: MyModel.objects.filter(...).count() This will do the couting at the database SELECT COUNT(*) FROM ... WHERE ...; If you know how to get

Re: How to use newforms ChoiceField to show dynamic choices

2008-01-25 Thread ikks
I have mod_python and I'm using ModelChoiceField, but I'm not getting the expected results, when I change my queryset and the second has elements not present on the original queryset, it displays the choices but doesn't validate properly, complaining about the option not being valid for the set.

Re: self-repeating form field

2008-01-25 Thread ikks
I am using geodjango, is it a way to have both newforms-admin and geodjango on the same trunk? newforms-admin looks really nice to be used, but right now I'm using geodjango for GIS. Any recommendations? It's an application of about 70 classes on models.py, If I'm right there would be

Re: How to use newforms ChoiceField to show dynamic choices

2008-01-25 Thread Artiom Diomin
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 YourCoolForm(forms.ModelForm): ~choices_field = forms.ModelChoiceField( ~queryset=UserProfile.objects.all()) ~def__init__(self, **kwargs): ~ super(YourCoolForm, self).__init__(**kwargs) ~

Re: newforms-admin replacement for core=True in inline models?

2008-01-25 Thread James T
Felix, > Inline objects now have a 'delete' checkbox which is used for removing > objects. Oh yeah! Well that answers the delete question, thanks. > I believe that the usual admin rules apply for creating models i.e. > all fields without blank=True will be required, otherwise you'll get >

CURD in relation with Meta option "unique_together"

2008-01-25 Thread Nader
Hallo, I have a model in which I have defined a "unique_togther" of two fields in Meta class section: from django.db import models from production.processors.models import Processor class Processoroutput(models.Model): processorID = models.IntegerField(primary_key=True,

Re: Following foreign key references

2008-01-25 Thread Rufman
I found out that Django doesn't use the related_name as an alias for the join, but an incremented name (strings, strings1, strings2, strings3 ...) Does anyone know why/how to change this? On Jan 25, 10:29 am, Rufman <[EMAIL PROTECTED]> wrote: > Hey > How can I follow the foreign key relation by

Following foreign key references

2008-01-25 Thread Rufman
Hey How can I follow the foreign key relation by related_name by using select_related()? ex: Class Strings(models.Model): string = CharField(max_length=255) Class Stuff(models.Model): spam = models.ForeignKey(Strings, db_column='spam', related_name='spam', db_index=True, blank=True)

Re: How to get sum of fields without using custom SQL?

2008-01-25 Thread Emanuele Pucciarelli
Il giorno 25/gen/08, alle ore 08:32, shabda ha scritto: > Instead is there some way I can get django to do this in the database, > where it runs a query like > select sum(hrs_worked) from Entry where job_id = job.id, without using > custom SQL? Just not yet: