Complex Form Widgets

2009-01-28 Thread Paul Johnston
Hi, Is it possible to use more complex form widgets than the documentation mentions? For example, with ToscaWidgets, it's possible to use components like popup calendars and rich text editors in forms (at least vaguely possible - if you can figure it out with the zero docs :) Is this possible wit

Re: admin sorting in ManyToMany fields

2009-01-28 Thread knight
Hi, You can do it by adding: class Meta: ordering = ['name'] to you Name class. Regards, Alex A. On Dec 24 2008, 9:17 am, "Aaron Lee" wrote: > Hi I have a ManyToMany field names in my class and I would like to show the > names in sorted order (according to 'name') in the admin interfa

Re: Complex Form Widgets

2009-01-28 Thread Donn
On Wednesday, 28 January 2009 09:46:09 Paul Johnston wrote: > Is it possible to use more complex form widgets In my *very* limited experience, I would say yes. The widgets are really javascript and all your Django view needs to worry about is what comes back via GET or POST. Fetch the data fr

Re: Creating test databases. Nose framework

2009-01-28 Thread Oleg Oltar
Can't find how to add predefined data to the db. Sorry for being silly, maybe someone can point me? Please On Wed, Jan 28, 2009 at 2:45 AM, Russell Keith-Magee wrote: > > On Wed, Jan 28, 2009 at 5:51 AM, Oleg Oltar wrote: > > Hi! > > I am trying to create few nose test for my application. >

Re: Anyway to see full UrlConf list of available imported urls?

2009-01-28 Thread NoviceSortOf
I can't get this code to work perhaps I'm not importing something but here is what I'm doing. from mysite root dir import settings import urls from django.core.urlresolvers import get_resolver # i then do a little checking print r dir(r) # verifies _get_url_patterns is in r module ['class',..

Re: django.core.mail - DEFAULT_FROM_EMAIL not employed

2009-01-28 Thread funkazio
Right! Thanks! The SERVER_EMAIL setting works properly with authenticated smtp server, yet using an authenticated server the (at least the one I tried: Gmail) the SERVER_EMAIL is overridden by the EMAIL_HOST_USER. Maybe that should be properly verified with several server and modified or document

Re: django.core.mail - DEFAULT_FROM_EMAIL not employed

2009-01-28 Thread funkazio
Right! Thanks! The SERVER_EMAIL setting works properly with a NOT-authenticated smtp server, yet using an authenticated server (at least the one I tried: Gmail) the SERVER_EMAIL is overridden by the EMAIL_HOST_USER. Maybe that should be properly verified with several server and modified or docume

Re: how to avoid hardcoding of logfile path in logging.conf file

2009-01-28 Thread Rama Vadakattu
Thanks bruno desthuilliers the tip which you have given is working. One more tweak which i have done is instead of LOG_PATH = "/whatever/you/want.log" in setting.py i have used LOG_PATH = "\"/whatever/you/want.log\"" otherwise it is throwing out some exception. Thanks Eric for your code.

Search in a ManyToManyField in Admin interface

2009-01-28 Thread João Olavo Baião de Vasconcelos
Hi all, I'd like to search in a m2mfield using the search_fields trick in admin interface (django 1.0.2). A simple example of models: """ class Book(models.Model): title = models.CharField(...) authors = models.ManyToManyField('author') class Author(models.Model): name = models.CharField(.

Re: Multithreaded development server

2009-01-28 Thread Almad
On 28 Led, 01:25, Russell Keith-Magee wrote: > On Tue, Jan 27, 2009 at 11:21 PM, Almad wrote: > Sorry, but my stress-induced fibritis can only take so much. As a > hint, if you ever find yourself in a position where you need to > apologize at the end of an email for the tone you've taken, it's >

About django validation system

2009-01-28 Thread Matias Surdi
Shouldn't validation be defined in the modell instead of the forms? Suppose I've a Model wich has some restrictions on the value a field can get, and then I've a custom form for this model for the admin interface and two other forms for the public interface. Does this mean that I've to define

Re: Multithreaded development server

2009-01-28 Thread Almad
On 28 Led, 06:01, Malcolm Tredinnick wrote: > On Tue, 2009-01-27 at 06:21 -0800, Almad wrote: > > On Jan 26, 1:19 am, Russell Keith-Magee > > wrote: > Perhaps you could show some simplified example code? I have at least a > few dozen tests that do this and they don't have any problem. Serial >

Re: About django validation system

2009-01-28 Thread Russell Keith-Magee
On Wed, Jan 28, 2009 at 8:45 PM, Matias Surdi wrote: > > Shouldn't validation be defined in the modell instead of the forms? There are cases where form validation is the right thing to do - for example, if you have a web form that isn't backed by a model. However, there is certainly a good argum

Re: how to avoid hardcoding of logfile path in logging.conf file

2009-01-28 Thread Vinay Sajip
On Jan 28, 11:07 am, Rama Vadakattu wrote: > Thanks bruno desthuilliers > the tip which you have given is working. > I think it's better just to have the logging configuration done at the bottom of settings.py (either programmatically or via fileConfig). Typically, if you have code in your app

Re: Anyway to see full UrlConf list of available imported urls?

2009-01-28 Thread NoviceSortOf
in the end i found django-command-extensions ESSENTIAL and INDISPENSIBLE in tracking and getting my head around URLConf. this extends django manage.py with a function called show_urls after you have installed django-command-extensions, all you have to do is type python manage.py show_urls to

Re: Bound Inline Formset doesn't render FileField's current value, needs to be reentered.

2009-01-28 Thread Rodrigo C.
Hi Malcolm, thanks for your reply. > So, perhaps you could give a small, reduced to the minimum, example of > how you're setting all this up. Maybe it's a problem in inline formsets, > or maybe it's an oversight in your code. At the moment, hard to tell. > I included the View and Model in my ori

Meta-information for model and form fields

2009-01-28 Thread Vinay Sajip
I'd like to attach some user-defined meta-information to individual model fields and have it also be available in the corresponding form fields. Ideally, I'd have liked to have a keyword arg on the fields... class MyModel(models.Model): name = models.CharField(max_length=100, info=some_object

Re: feeds and repetition

2009-01-28 Thread Torsten Bronger
Hallöchen! Donn writes: > [...] > > Do I have to worry about this sameness -- or does the syndication > system remove duplicates? Is this a Django thing or an RSS thing? > i.e. where does it look at the data and say 'drop this, it's the > same as last time'? If the ID of an entry is already kno

Re: feeds and repetition

2009-01-28 Thread Donn
On Wednesday, 28 January 2009 14:49:27 Torsten Bronger wrote: > If the ID of an entry is already known to the feedreader, it isn't > displayed. Okay, so it's built-into the reader. Thanks. \d -- Where I web: http://otherwise.relics.co.za/ Comics, tutorials, software and sundry --~--~-

Re: Django Forms in HTML 4.01 Strict

2009-01-28 Thread Gertjan Klein
Malcolm Tredinnick wrote: >In HTML, the requirement for errors of this form ( instead of >), is that the parser *must* recover in a way that forces it to >treat it as "" -- it has to ignore the invalid characters and >recover in a particular, well-defined fashion. Do you have a reference for tha

EuroDjangoCon '09

2009-01-28 Thread Robert Lofthouse
EuroDjangoCon '09 will be on May 4th, 5th and 6th (possibly also 7th) 2009 in Prague. For further information go to: http://euro.djangocon.org/ Blog announcement: http://euro.djangocon.org/blog/2009/1/24/eurodjangocon-announcement/ Further information will be released shortly. The call for part

Re: Common fields in an abstract class, with customized db_column values for concrete models

2009-01-28 Thread psj
> It would be a little fiddly to add, but not impossible. Not sure it's > really worth it for Django's core, however, since it's an edge-case and > ABC's are only a convenience, not a requirement. Thanks Malcolm. That makes sense to me. I'm sure I could figure out how to do this in the fiddly bit

Re: ObjectPaginator

2009-01-28 Thread Justin Myers
Pagination changed quite a bit in 1.0. There's a chance you'll have to change more than simply get_page(). An easier-to-read list of the Paginator and Page methods and attributes is here: http://docs.djangoproject.com/en/dev/topics/pagination/#paginator-objects (I ran into the same problem trying

Re: Multithreaded development server

2009-01-28 Thread Ned Batchelder
Almad, you've pointed to ticket 10117 a few times now, but I don't see how this has anything to do with a single-threaded server. I think if you could clarify that point, maybe we'd be able to make some progress on this. The core devs are not going to change their mind about multi-threading t

Re: passing self?

2009-01-28 Thread ajlozier
Thank you for responding. Yeah I was starting to figure out just what you're saying, that I can't access the functions of a class within the class definition itself. This is also true in PHP. In this case, if I were writing in PHP I would do something like this: function __construct(){ pa

Re: File as data backend for model

2009-01-28 Thread Matthias Julius
Jeff Hammerbacher writes: > Hey Matthias, > > To use Django's model object for this task, you will need to implement a > custom manager for your file's structure; you can see some basic > documentation at > http://docs.djangoproject.com/en/dev/topics/db/managers/#topics-db-managers. > It should

Django Admin module without login feature

2009-01-28 Thread Saurav
Hi All, I wanted to use the some of the features of django administration modules without the login feature. In my project there is no concepts of users, Can anybody tell me if its possible and if its possible, how to do it ? Thanks in advance -Saurav --~--~-~--~~~--

Re: admin sorting in ManyToMany fields

2009-01-28 Thread Aaron Lee
I tried doing that but it didn't work, the order of names within the PersonAdmin still shows the Name according to pk order. -Aaron On Wed, Jan 28, 2009 at 1:03 AM, knight wrote: > > Hi, > > You can do it by adding: > > class Meta: >ordering = ['name'] > > to you Name class. > Regards,

Re: File as data backend for model

2009-01-28 Thread Matthias Julius
Malcolm Tredinnick writes: > On Tue, 2009-01-27 at 17:13 -0500, Matthias Julius wrote: >> I am trying to write a model for which the data can be represented as >> a simple array of a fixed number of one byte integers. To use a >> SQL database for that would be very much overkill. I would simpl

Re: Django VBulletin auth backend

2009-01-28 Thread Bashar
Hello, Did you find a solution for this? i believe there are lots of bridges out there for joomla/vbulletin for example i think its doable in django easily for any python guy On Jan 14, 10:12 pm, "Chris H." wrote: > Has anybody done any work on writing a Django auth backend for an > existingVB

Complex queries with datetime field

2009-01-28 Thread Stefan Tunsch
Hi! I have a calendar that permits multiple selections of dates. My view has to filter the data depending on the selected dates. I am unsure about how I can construct a query that filters correctly the data. I construct my list of datetime objects like this: list = request.session['selected_

Re: ObjectPaginator

2009-01-28 Thread Patricio Palma
Yeah, versions problems I fix it downloading the lasted rosetta version from svn. svn co http://django-rosetta.googlecode.com/svn/trunk/ Ty a lot --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

Re: Adjusting these models for other functionality

2009-01-28 Thread Almost George
On Jan 27, 9:56 pm, Malcolm Tredinnick wrote: > On Tue, 2009-01-27 at 09:57 -0800,AlmostGeorgewrote: > > -- MODELS -- ( Other, unimportant fields/models have been removed ) > > >    class Band(models.Model): > >            name    = models.CharField(max_length = 50, unique = True) > > >    clas

ANN: Launch of the djangoproject.cz site

2009-01-28 Thread Plovarna
Hello, I would like call to attention to launch of the Czech site about the Django framework. Like other national versions, this web is targeted mainly to Django beginners. I hope that this site will speak to wide range of Czech developers and it will bring more popularity to Django in my c

Re: Creating test databases. Nose framework

2009-01-28 Thread Oleg Oltar
Any idea? On Wed, Jan 28, 2009 at 11:41 AM, Oleg Oltar wrote: > Can't find how to add predefined data to the db. Sorry for being silly, > maybe someone can point me? > Please > > > On Wed, Jan 28, 2009 at 2:45 AM, Russell Keith-Magee < > freakboy3...@gmail.com> wrote: > >> >> On Wed, Jan 28,

Re: Creating test databases. Nose framework

2009-01-28 Thread varikin
On Jan 27, 5:00 pm, Oleg Oltar wrote: > So if I have to store a User object in db (with fields (name, email, pass) > How should I define the fixture? Should I define it in setup? When I created my fixtures for my tests, I did ran[1] ./manage.py dumpdata auth > auth.json Then I just edited au

Django admin "Change password / Log out" urls wrong

2009-01-28 Thread Blixt
Hi there. As the subject states, the urls for changing password and logging out are wrong, while the rest of the urls in the admin application are correct. The problem with those two urls is that they start with "admin/", even if I'm already in the admin "directory." For them to work, they should

Re: Django admin "Change password / Log out" urls wrong

2009-01-28 Thread Karen Tracey
On Wed, Jan 28, 2009 at 10:16 AM, Blixt wrote: > > Hi there. > > As the subject states, the urls for changing password and logging out > are wrong, while the rest of the urls in the admin application are > correct. The problem with those two urls is that they start with > "admin/", even if I'm al

Re: Search in a ManyToManyField in Admin interface

2009-01-28 Thread Karen Tracey
On Wed, Jan 28, 2009 at 6:19 AM, João Olavo Baião de Vasconcelos < joaool...@gmail.com> wrote: > Hi all, > > I'd like to search in a m2mfield using the search_fields trick in admin > interface (django 1.0.2). > > A simple example of models: > """ > class Book(models.Model): > title = models.Char

Re: Multithreaded development server

2009-01-28 Thread Almad
On 28 Led, 15:20, Ned Batchelder wrote: > Almad, you've pointed to ticket 10117 a few times now, but I don't see > how this has anything to do with a single-threaded server.  I think if > you could clarify that point, maybe we'd be able to make some progress > on this. True, I just got that feel

Re: Django admin "Change password / Log out" urls wrong

2009-01-28 Thread Blixt
Ah, it certainly sounds like it! Thanks for the heads up! Regards, Andreas On Jan 28, 4:27 pm, Karen Tracey wrote: > On Wed, Jan 28, 2009 at 10:16 AM, Blixt wrote: > > > Hi there. > > > As the subject states, the urls for changing password and logging out > > are wrong, while the rest of the u

Re: Bound Inline Formset doesn't render FileField's current value, needs to be reentered.

2009-01-28 Thread Karen Tracey
On Tue, Jan 27, 2009 at 5:48 PM, Rodrigo C. wrote: > > > This isn't a Django issue. It's a standard property of browsers: you > > can't set an initial value for file input fields. This is a security > > measure, to stop malicious pages uploading files from your hard drive > > without your explici

Re: Search in a ManyToManyField in Admin interface

2009-01-28 Thread João Olavo Baião de Vasconcelos
On Wed, Jan 28, 2009 at 1:31 PM, Karen Tracey wrote: > You are including the __name in your manual search but you left it out of > the search_fields you listed in your ModelAdmin. So what happens if you > make search_fields = ['title', 'authors__name']? > I did it, and got this error message: *

'FtrToolTags' is not a valid tag library: Could not load template library from django.templatetags.FtrToolTags, cannot import name Product

2009-01-28 Thread Thiago F. Crepaldi
Hello, a created a new model on a already working system in my development computer. When i finished it, i exported those mysql data data through phpmyadmin and imported to the production table. When i deployed the new site, i got: TemplateSyntaxError at 'FtrToolTags' is not a valid tag library:

Re: 'FtrToolTags' is not a valid tag library: Could not load template library from django.templatetags.FtrToolTags, cannot import name Product

2009-01-28 Thread Karen Tracey
On Wed, Jan 28, 2009 at 12:03 PM, Thiago F. Crepaldi wrote: > > Hello, a created a new model on a already working system in my > development computer. When i finished it, i exported those mysql data > data through phpmyadmin and imported to the production table. When i > deployed the new site, i g

settings.EMAIL_HOST_USER problem

2009-01-28 Thread madhav
I need some help regarding django emailing. I have set the settings.EMAIL_HOST_USER to 'do-not-re...@mysite.com' and whenever I am trying to send an email in any context, its taking the 'do-not- re...@mysite.com' as from address and sending it, eventhough I supply a different from-address while se

Problems with authentication login/logout

2009-01-28 Thread Matias Surdi
I've followed the documentation on users authentication and it's working fine except for one thing. When a user logs out from the public views, it is also logged out from the admin site and when the user logs in in the public view, if it has staff permission it can access the admin site.So far

Re: Search in a ManyToManyField in Admin interface

2009-01-28 Thread Karen Tracey
On Wed, Jan 28, 2009 at 11:46 AM, João Olavo Baião de Vasconcelos < joaool...@gmail.com> wrote: > On Wed, Jan 28, 2009 at 1:31 PM, Karen Tracey wrote: > >> You are including the __name in your manual search but you left it out of >> the search_fields you listed in your ModelAdmin. So what happen

Re: settings.EMAIL_HOST_USER problem

2009-01-28 Thread Karen Tracey
On Wed, Jan 28, 2009 at 12:20 PM, madhav wrote: > > I need some help regarding django emailing. I have set the > settings.EMAIL_HOST_USER to 'do-not-re...@mysite.com' and whenever I > am trying to send an email in any context, its taking the 'do-not- > re...@mysite.com' as from address and sendin

Re: settings.EMAIL_HOST_USER problem

2009-01-28 Thread madhav
Thankyou Tracey, You are right about settings.EMAIL_HOST_USER not getting overriden from django.core.email. Even I checked it. But the current behaviour is a bit confusing. Because, I can have a default email id for the entire application(like sys...@mysite.com or do-not- re...@mysite.com) which w

Re: Problems with authentication login/logout

2009-01-28 Thread Matias Surdi
Matias Surdi escribió: > I've followed the documentation on users authentication and it's working > fine except for one thing. > > When a user logs out from the public views, it is also logged out from > the admin site and when the user logs in in the public view, if it has > staff permission

Re: Changing comments preview form

2009-01-28 Thread Florian Lindner
Am 28.01.2009 um 05:19 schrieb Malcolm Tredinnick: > > On Tue, 2009-01-27 at 20:11 +0100, Florian Lindner wrote: >> Hello, >> >> I'm playing around with the contrib.comments framework. I want to >> change the preview form. For that I've copied preview.html to xgm/ >> Blog/ >> templates/comments

Re: Search in a ManyToManyField in Admin interface

2009-01-28 Thread Ian
On Jan 28, 9:46 am, João Olavo Baião de Vasconcelos wrote: > On Wed, Jan 28, 2009 at 1:31 PM, Karen Tracey wrote: > > You are including the __name in your manual search but you left it out of > > the search_fields you listed in your ModelAdmin.  So what happens if you > > make search_fields = ['

Re: settings.EMAIL_HOST_USER problem

2009-01-28 Thread madhav
To add to my previous reply Even EmailMessage class has got from_email attribute which means it can have dynamic EmailMessage. If it has to only pick settings.EMAIL_HOST_USER, why would it require a atttribute called from_email? On Jan 28, 11:18 pm, madhav wrote: > Thankyou Tracey, > You are

Re: settings.EMAIL_HOST_USER problem

2009-01-28 Thread Karen Tracey
On Wed, Jan 28, 2009 at 1:18 PM, madhav wrote: > > Thankyou Tracey, > You are right about settings.EMAIL_HOST_USER not getting overriden > from django.core.email. Even I checked it. > But the current behaviour is a bit confusing. Because, I can have a > default email id > for the entire applicati

ImportError: No module named django.core.handlers.modpython

2009-01-28 Thread saturdayplace
I'm trying to get Django set up on a new webserver, and I get the above error. Here's my setup: $python Python 2.5 (r25:51908, Apr 10 2007, 10:29:13) [GCC 4.1.2 20070403 (Red Hat 4.1.2-8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> >>> import django >>>

django.core.mail.EmailMessage confusion

2009-01-28 Thread madhav
I am trying to fire emails to users, using EmailMessage class. As we all know it accepts from_email,subject,etc... But assume a case where a site's user has got an email like: ser...@google.com(which the site owner's didn't confirm previously), and he is sending an email to el...@yahoo.com(which f

Re: settings.EMAIL_HOST_USER problem

2009-01-28 Thread Karen Tracey
On Wed, Jan 28, 2009 at 1:39 PM, madhav wrote: > > To add to my previous reply > Even EmailMessage class has got from_email attribute which means it > can have dynamic EmailMessage. > If it has to only pick settings.EMAIL_HOST_USER, why would it require > a atttribute called from_email? > EM

Re: Several browser windows, one session object - should I be locking django session objects?

2009-01-28 Thread Matthias Julius
Michael Newman writes: > On Jan 27, 4:52 pm, Matthias Julius wrote: >> mvtango writes: >> > my users keep several browser windows open in my application, I need >> > to keep session information for all these windows separate. But I have >> > only one session object - modifying it while the use

Re: django.core.mail.EmailMessage confusion

2009-01-28 Thread Karen Tracey
On Wed, Jan 28, 2009 at 1:53 PM, madhav wrote: > > I am trying to fire emails to users, using EmailMessage class. As we > all know it accepts from_email,subject,etc... > But assume a case where a site's user has got an email like: > ser...@google.com(which the site owner's didn't confirm previous

Re: ImportError: No module named django.core.handlers.modpython

2009-01-28 Thread Karen Tracey
On Wed, Jan 28, 2009 at 1:48 PM, saturdayplace wrote: > > I'm trying to get Django set up on a new webserver, and I get the > above error. Here's my setup: > > $python > Python 2.5 (r25:51908, Apr 10 2007, 10:29:13) > [GCC 4.1.2 20070403 (Red Hat 4.1.2-8)] on linux2 > Type "help", "copyright", "c

ForeignKey.limit_choices_to

2009-01-28 Thread msmtotti
Hola que tal, eh buscado informacion en la documentaciony encontre esta propiedad "ForeignKey.limit_choices_to" para delimitar mi ForeignKey. Lo que quiero hacer es delimitar mi ForeignKey de grupo_pregunta para que solo me tome el id, del script Eh intentado ponerlo asi pero me marca el sigiuent

Custom authentication backend and User passwords

2009-01-28 Thread Delta20
Is there a way to make it so that when you create a User in admin, the password is set such that the user cannot login using ModelBackend? I'm using two authentication backends, a custom backend and Modelbackend: i.e.: AUTHENTICATION_BACKENDS = ('myapp.auth.ActiveDirectoryBackend', 'django.contr

How to do Refbacks in Django?

2009-01-28 Thread Fluoborate
Hello, I would like some suggestions for how to do refbacks in Django. Every time someone clicks a link that brings them to my site, I want to record what site referred them. This is done using the HTTP referrer header. Here are my questions: 1. Does the code to do this already exist somewhere (

Re: settings.EMAIL_HOST_USER problem

2009-01-28 Thread madhav
Awesome Tracey. Almost all of my doubts regarding django emailing are gone. Except One. Assuming I haven't set anything in the settings regarding emailing. So NO EMAIL_HOST_USER, nothing else... I try sending the email from the django shell(python manage.py shell) to somevalidu...@xyz.com, using

Re: Search in a ManyToManyField in Admin interface

2009-01-28 Thread João Olavo Baião de Vasconcelos
I think that I realised what is the problem. Karen, just add a TextField to the Book model (say, "description = models.TextField()"), try to search for something and you'll see that error message. I'm not 100% sure about it, coz I tested this at work and then came home. Probably is the same bug r

Re: ImportError: No module named django.core.handlers.modpython

2009-01-28 Thread saturdayplace
On Jan 28, 12:31 pm, Karen Tracey wrote: > On Wed, Jan 28, 2009 at 1:48 PM, saturdayplace wrote: > > > > > > > I'm trying to get Django set up on a new webserver, and I get the > > above error.  Here's my setup: > > > $python > > Python 2.5 (r25:51908, Apr 10 2007, 10:29:13) > > [GCC 4.1.2 2007

media files apache/modpython windows

2009-01-28 Thread May
Hello, I have the admin templates with CSS working under local server windows/ apache/modpython. Now I would like to get my site css files to work under apache. The settings and http.conf code is here: http://dpaste.com/114010/ I can place mysite css and images under the apache htdocs, but I c

can i use models like that??

2009-01-28 Thread Mirat Can Bayrak
Can you look at these, can they work? i tried that one but not worked, is there way to make it working? (nope, there was no error messages, only strings are not shown at admin panel) LANGUAGE_OPTIONS = (('en_GB', '(British) English'), ('tr', 'Turkish'), ('es', 'Spanish')) class ShortDescriptio

links in table - one for URL, one not

2009-01-28 Thread May
Hello, I am extracting data from a postgres table into an html table. I have two columns. The user can select the link in this column, the link will be returned through the URL and view.py to extract more information from the postgres table: {{ researchproject.restitle| safe }} This column wi

Changing database fields

2009-01-28 Thread Oleg Oltar
Hi! I am creating my first application. Which is to be a small publishing system. I defined a model, which represent a single article, and also added about 15 articles to my database (which is sqlite3). Now I understand that I should extend my models with few more fields (e.g. need to add categor

Re: Search in a ManyToManyField in Admin interface

2009-01-28 Thread Ian
On Jan 28, 1:25 pm, João Olavo Baião de Vasconcelos wrote: > I think that I realised what is the problem. > > Karen, just add a TextField to the Book model (say, "description = > models.TextField()"), try to search for something and you'll see that error > message. I'm not 100% sure about it, coz

Re: ImportError: No module named django.core.handlers.modpython

2009-01-28 Thread saturdayplace
OK - so it looks like it was a permissions problem. I moved my django-1.0.X and django-projects directories to /var/www where my apache could get to it, and that seems to have cleared everything up. Thanks for the pointer. On Jan 28, 1:39 pm, saturdayplace wrote: > On Jan 28, 12:31 pm, Karen Tr

Re: ImportError: No module named django.core.handlers.modpython

2009-01-28 Thread Karen Tracey
On Wed, Jan 28, 2009 at 3:39 PM, saturdayplace wrote: > > Ahh. OK, so I installed django in /home/thunsaker/python_modules/ > django-trunk. And then did: >ln -s /home/thunsaker/python_modules/django-trunk/django /usr/lib/ > python2.5/site-packages > so that django's on the pythonpath. I'm u

Re: media files apache/modpython windows

2009-01-28 Thread Karen Tracey
On Wed, Jan 28, 2009 at 3:39 PM, May wrote: > > Hello, > > I have the admin templates with CSS working under local server windows/ > apache/modpython. Now I would like to get my site css files to work > under apache. > > The settings and http.conf code is here: > http://dpaste.com/114010/ > > I

Re: Changing database fields

2009-01-28 Thread Mark Jones
This is where Rails rocks and DJango doesn't. I haven't been able to find any kind of DB Migrations in Django like those in Rails. Sad too, because other than that, Python is a lot nicer than Ruby (Syntax wise for an old C++ programmer) On Jan 28, 3:29 pm, Oleg Oltar wrote: > Hi! > I am creati

Re: Changing database fields

2009-01-28 Thread Karen Tracey
On Wed, Jan 28, 2009 at 4:29 PM, Oleg Oltar wrote: > Hi! > I am creating my first application. Which is to be a small publishing > system. > > I defined a model, which represent a single article, and also added about > 15 articles to my database (which is sqlite3). > > Now I understand that I sho

Debug output from template language?

2009-01-28 Thread Margie
Is there a way to generate debug output from the template language? Suppose I have something like this: {% for field in form %} {{ field.label_tag }}{{ field }} {% if field.help_text %} {{ field.help_text }}{% endif %} {% endfor %} Suppose I want to

Re: links in table - one for URL, one not

2009-01-28 Thread Karen Tracey
On Wed, Jan 28, 2009 at 4:28 PM, May wrote: > > Hello, > > I am extracting data from a postgres table into an html table. I have > two columns. > > The user can select the link in this column, the link will be returned > through the URL and view.py to extract more information from the > postgres

django admin model organization

2009-01-28 Thread matthew.j.ga...@gmail.com
I love the admin interface, and it works perfectly for almost every aspect of the application I am writing. However, I have discovered that the default behavior of the admin interface to list all models in one grouping is not ideal in my case... I have a *large* number of models (that are based o

Re: settings.EMAIL_HOST_USER problem

2009-01-28 Thread Karen Tracey
On Wed, Jan 28, 2009 at 3:21 PM, madhav wrote: > > Awesome Tracey. > > Almost all of my doubts regarding django emailing are gone. Except > One. Assuming I haven't set anything in the settings regarding > emailing. So NO EMAIL_HOST_USER, nothing else... I try sending the > email from the django s

ContentTypes and fixtures

2009-01-28 Thread Oliver Beattie
Hey everyone, I'm converting some of my stuff over to use Django fixtures instead of the old dump-import a SQL file. This is all going very well, until I realised that my GenericForeignKeys might be broken if I rely on fixtures. In my old SQL method, this was not an issue as I could guarantee th

Improving the response time in Django Admin

2009-01-28 Thread Tipan
We're running several Django sites on 3 dedicated servers with (1 app, 1 media and 1 data). The sites generally run pretty quickly for users. We are using db caching (we'll be moving to mem_cached in due course) on most views other than those showing specific user data. The site has about 90,000 r

Re: Improving the response time in Django Admin

2009-01-28 Thread Karen Tracey
On Wed, Jan 28, 2009 at 5:41 PM, Tipan wrote: > > We're running several Django sites on 3 dedicated servers with (1 app, > 1 media and 1 data). The sites generally run pretty quickly for users. > We are using db caching (we'll be moving to mem_cached in due course) > on most views other than thos

Re: Changing database fields

2009-01-28 Thread Russell Keith-Magee
On Thu, Jan 29, 2009 at 6:53 AM, Mark Jones wrote: > > This is where Rails rocks and DJango doesn't. I haven't been able to > find any kind of DB Migrations in Django like those in Rails. Sad > too, because other than that, Python is a lot nicer than Ruby (Syntax > wise for an old C++ programme

Re: ContentTypes and fixtures

2009-01-28 Thread Russell Keith-Magee
On Thu, Jan 29, 2009 at 7:36 AM, Oliver Beattie wrote: > > How can I be sure that the ContentType IDs are always constant, and > therefore my data in fixtures is guaranteed to always point to the > right object? Oliver, meet ticket #7052. Ticket #7052, meet Oliver :-) This is an annoying bug th

Re: Improving the response time in Django Admin

2009-01-28 Thread Russell Keith-Magee
On Thu, Jan 29, 2009 at 7:41 AM, Tipan wrote: > > Can anyone suggest some areas to explore to improve the response time > on the Admin. We're currently on release 7476 (pre new forms admin), > but due to go to the latest development release next week, although > I'm not sure how significant this

Re: media files apache/modpython windows

2009-01-28 Thread Brian Neal
On Jan 28, 3:51 pm, Karen Tracey wrote: > On Wed, Jan 28, 2009 at 3:39 PM, May wrote: > > > Hello, > > > I have the admin templates with CSS working under local server windows/ > > apache/modpython.  Now I would like to get my site css files to work > > under apache. > > > The settings and http

Re: 'FtrToolTags' is not a valid tag library: Could not load template library from django.templatetags.FtrToolTags, cannot import name Product

2009-01-28 Thread Thiago F. Crepaldi
in models.py all the code is ok. Is there any procedure to "register" Product ? when i type "python" in my red hat console, nothings happens, so i can't run "python manage.py syncdb" Would that be the reason Product is not recognized ? it is the only new model inserted into the project r...@serv

Re: Meta-information for model and form fields

2009-01-28 Thread Malcolm Tredinnick
On Wed, 2009-01-28 at 04:27 -0800, Vinay Sajip wrote: > I'd like to attach some user-defined meta-information to individual > model fields and have it also be available in the corresponding form > fields. Ideally, I'd have liked to have a keyword arg on the fields... > > class MyModel(models.Mode

Re: Complex Form Widgets

2009-01-28 Thread Malcolm Tredinnick
On Wed, 2009-01-28 at 11:48 +0200, Donn wrote: > On Wednesday, 28 January 2009 09:46:09 Paul Johnston wrote: > > Is it possible to use more complex form widgets > In my *very* limited experience, I would say yes. > > The widgets are really javascript and all your Django view needs to worry > a

Re: admin sorting in ManyToMany fields

2009-01-28 Thread Malcolm Tredinnick
On Wed, 2009-01-28 at 06:49 -0800, Aaron Lee wrote: > I tried doing that but it didn't work, the order of names within the > PersonAdmin still shows the Name according to pk order. Firstly, realise that your question doesn't have a "correct" answer. Ordering by multi-valued fields always have th

admin_perm_test decorator?

2009-01-28 Thread Ian Cullinan
The docs at http://docs.djangoproject.com/en/dev/ref/contrib/admin/#protecting-custom-adminsite-and-modeladmin say to use the "decorator provided in django.contrib.admin.utils.admin_perm_test" to protect custom AdminSite and ModelAdmin views, but it doesn't exist (in 1.0, at least): $ pwd /us

Re: Complex queries with datetime field

2009-01-28 Thread Malcolm Tredinnick
On Wed, 2009-01-28 at 16:10 +0100, Stefan Tunsch wrote: > Hi! > > I have a calendar that permits multiple selections of dates. > > My view has to filter the data depending on the selected dates. > > I am unsure about how I can construct a query that filters correctly the > data. > > I constru

Re: Creating test databases. Nose framework

2009-01-28 Thread Malcolm Tredinnick
On Wed, 2009-01-28 at 17:19 +0200, Oleg Oltar wrote: > Any idea? Generally, you'll want to wait more than 6 hours before asking again. A couple of days, at least, would be a reasonable period. > On Wed, Jan 28, 2009 at 11:41 AM, Oleg Oltar > wrote: > Can't find how to add predefined da

Any django users in Malaysia/Singapore

2009-01-28 Thread ycloh
Hi all, just wondering if there are many django users in this part of this world and how is django being used. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: Changing comments preview form

2009-01-28 Thread Malcolm Tredinnick
On Wed, 2009-01-28 at 19:24 +0100, Florian Lindner wrote: > > Am 28.01.2009 um 05:19 schrieb Malcolm Tredinnick: > > > > > On Tue, 2009-01-27 at 20:11 +0100, Florian Lindner wrote: > >> Hello, > >> > >> I'm playing around with the contrib.comments framework. I want to > >> change the preview for

Re: Custom authentication backend and User passwords

2009-01-28 Thread Malcolm Tredinnick
On Wed, 2009-01-28 at 11:34 -0800, Delta20 wrote: > Is there a way to make it so that when you create a User in admin, the > password is set such that the user cannot login using ModelBackend? Have a look at this: http://docs.djangoproject.com/en/dev/topics/auth/#django.contrib.auth.models.User.s

Re: Debug output from template language?

2009-01-28 Thread Malcolm Tredinnick
On Wed, 2009-01-28 at 14:05 -0800, Margie wrote: > Is there a way to generate debug output from the template language? > Suppose I have something like this: > > {% for field in form %} > {{ field.label_tag }}{{ field }} tr> > {% if field.help_text %} > {{ fiel

Re: How to do Refbacks in Django?

2009-01-28 Thread Malcolm Tredinnick
On Wed, 2009-01-28 at 11:49 -0800, Fluoborate wrote: > Hello, > > I would like some suggestions for how to do refbacks in Django. Every > time someone clicks a link that brings them to my site, I want to > record what site referred them. This is done using the HTTP referrer > header. Here are my

  1   2   >