Boolean field as radio button?

2009-06-19 Thread Masarliev
Hi all, sorry for my bad english. I have db model class that is shown in django admin as inline but boolean fields are checkboxes. how can i replace them with radio buttons --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: django-logging

2009-06-19 Thread Rama Vadakattu
1. you can initialize the root logger in settings and use it across every application. in such cases you need to embed the name in the log message for easy debugging. Other disadvantage is : you can't customize your logging on application basis (like) i want only debug messages from

Re: My templates don't render correctly

2009-06-19 Thread mojo
Will... I thought there is a problem with "media_root","settings.py", or the way I served the static files... I didn't expect that at all... But, that solved the problem! I really appreciated it! Thank you! On Jun 19, 9:03 pm, Gabriel wrote: > -BEGIN PGP SIGNED

Re: Permissions

2009-06-19 Thread James Bennett
On Fri, Jun 19, 2009 at 6:35 PM, poop wrote: > Basically, I have a small CMS/publishing web app I have been working > on for a few weeks.  It is coming together nicely (though getting > LaTeX to play nice took longer than I expected).  Anyway, there is a > notion of a

Re: Limit the number of forms in a Formset.

2009-06-19 Thread Karen Tracey
On Fri, Jun 19, 2009 at 5:01 PM, Sonal Breed wrote: > > Hi all, > I am trying to display a formset in my application such that it only > contains number of forms equal to number of database instances. > > My models are as below: > class Card(models.Model): > name =

Re: Why why why not write a search module for Django user?

2009-06-19 Thread poop
On Jun 19, 5:59 pm, James Bennett wrote: > On Fri, Jun 19, 2009 at 6:49 PM, poop wrote: > > It is not, but it is not much of a web application framework if it > > doesn't already have a rich set of tools to work with. > > It does. Of course, your

Re: Empty [] using objects.all() on legacy database

2009-06-19 Thread Greg Corey
I will try that tomorrow and let you know. The DB is an old Microsoft Access database that was then migrated to MySQL. It was designed by a definite novice so it has quirks, but it still pumps along. It is a DB of testing results for our small laboratory. Greg On Fri, Jun 19, 2009 at 8:00 PM,

Re: Empty [] using objects.all() on legacy database

2009-06-19 Thread Karen Tracey
On Fri, Jun 19, 2009 at 4:41 PM, geraldcor wrote: > > Ok, so I feel a bit silly, but it was because I had a column name in > my db called Discount% and I am assuming the % is screwing it up. > > Now the question becomes how do I escape the % or do I have to rename > my db

Re: My templates don't render correctly

2009-06-19 Thread Gabriel
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 mojo escribió: > {% block title %} Home {% endblock title %} > type="text/css" / >

Re: Why why why not write a search module for Django user?

2009-06-19 Thread James Bennett
On Fri, Jun 19, 2009 at 6:49 PM, poop wrote: > It is not, but it is not much of a web application framework if it > doesn't already have a rich set of tools to work with. It does. Of course, your issue seems to be not that Django lacks certain tools, but that it doesn't

Re: My templates don't render correctly

2009-06-19 Thread mojo
Thanks for the reply Karen... but I still didn't get the CSS thing. here how is "mysite" folder looks like: settings.py urls.py ... ... templates/ - _base.html - index.html - work/ - _base_work.html - subfold1/ -sub1_index.html -

Re: Should this be its own app?

2009-06-19 Thread Kenneth Gonsalves
On Friday 19 June 2009 16:05:00 Chris Withers wrote: > > I personally would put everything in one app at the start. If things > > start to grow and you want to reuse that part in another project, or > > release it to the public (and become famous), then it makes sense to > > factor it out into a

Installation error

2009-06-19 Thread 78fxs
All righty...not only am i new to django and python, i am new to using the terminal on my mac. so this is going to be mickey mouse stuff. i have a few things going on: 1. i think some of my confusion is knowing where these django and python folders should be. after i install python and django,

Permissions

2009-06-19 Thread poop
Hello everybody, I have a question about permissions, and would like your opinion about which approach to take. Basically, I have a small CMS/publishing web app I have been working on for a few weeks. It is coming together nicely (though getting LaTeX to play nice took longer than I expected).

Re: Why why why not write a search module for Django user?

2009-06-19 Thread poop
> > http://haystacksearch.org/ > > Django is not a CMS. > It is not, but it is not much of a web application framework if it doesn't already have a rich set of tools to work with. I could kill whoever told me Django was great, and forgot to mention there's no row-level permissions...

Re: active django battery projects

2009-06-19 Thread Andy McKay
There's also a list of plugins at http://djangozen.com/plugins/ -- Andy McKay www.clearwind.ca On 2009-06-19, at 1:14 PM, notcourage wrote: > > I for one would be interested in replies showcasing django battery > projects underway. As a new django user, I'm stumbling

Re: TypeError: 'module' object is not callable

2009-06-19 Thread db_333
I wanted to later implement a login based on a user session, and I got some guidance from pretty decent Django book on learning to build websites with Django. However, I can see that I need to better understand how the middleware APIs work before I jump ahead. I appreciate your quick responses

Re: TypeError: 'module' object is not callable

2009-06-19 Thread Alex Gaynor
On Fri, Jun 19, 2009 at 6:24 PM, db_333 wrote: > > here's what I have for the Middleware: > > MIDDLEWARE_CLASSES = ( >'django.middleware.common.CommonMiddleware', >'django.contrib.sessions.middleware.SessionMiddleware', >

Re: TypeError: 'module' object is not callable

2009-06-19 Thread db_333
here's what I have for the Middleware: MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.models' ) I'm searching the APIs

Re: TypeError: 'module' object is not callable

2009-06-19 Thread Andy McKay
On 19-Jun-09, at 3:38 PM, db_333 wrote: > File "/Library/Python/2.5/site-packages/django/core/handlers/ > wsgi.py", line 228, in __call__ >self.load_middleware() > File "/Library/Python/2.5/site-packages/django/core/handlers/ > base.py", line 47, in load_middleware >mw_instance =

Re: TypeError: 'module' object is not callable

2009-06-19 Thread Alex Gaynor
On Fri, Jun 19, 2009 at 5:38 PM, db_333 wrote: > > Hi, > > I am new to Django and am trying to create a simple form around an > existing database (I'm using 1.0). The Model I have looks like this: > > class Units(models.Model): >serial_number =

TypeError: 'module' object is not callable

2009-06-19 Thread db_333
Hi, I am new to Django and am trying to create a simple form around an existing database (I'm using 1.0). The Model I have looks like this: class Units(models.Model): serial_number = models.CharField(max_length=25, primary_key=True) build = models.CharField(max_length=50, blank=True)

Re: IBM Dataservers backend support in Django application Framework.

2009-06-19 Thread James Bennett
> Feedback/Suggestions/Issues > > You can provide us feedback/suggestions, or report a bug/defect, or > ask for help by using any of the following channels: > 1. Mailing us at open...@us.ibm.com > 2. Opening a new issue at

What editor do you use for .po files?

2009-06-19 Thread Joshua Russo
I started using PoEdit but it seems to thing that the .po files created by makemessages are malformed, or at least don't have all the right headers. Is there a better editor for Windows? --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Limit the number of forms in a Formset.

2009-06-19 Thread Sonal Breed
Hi all, I am trying to display a formset in my application such that it only contains number of forms equal to number of database instances. My models are as below: class Card(models.Model): name = models.CharField(max_length=20, blank=False, null=False, unique=True) def __str__(self):

Re: active django battery projects

2009-06-19 Thread Rajesh D
On Jun 19, 4:14 pm, notcourage wrote: > I for one would be interested in replies showcasing django battery > projects underway. As a new django user, I'm stumbling on some active, > useful projects (django piston, south) and wondering if there are > projects addressing my

Re: production sites powered by django

2009-06-19 Thread Rajesh D
On Jun 19, 4:10 pm, notcourage wrote: > http://www.djangosites.org/ > is missing info like load, scaling techniques used, utilities written > (e.g., custom tags, custom form fields, custom model fields, wish > list. I don't see how one adds a site. Create an account there

Re: Gallery album restricted to certain users

2009-06-19 Thread Rajesh D
> > > > On Jun 17, 7:41 am, pagetribe wrote: > > > > Hi, > > > > I have been creating a gallery, which has albums. I would like to > > > restrict the albums, say album1 to a set of users, say userA and userB > > > and album2 to userC. So userA & userB cannot view

Re: Empty [] using objects.all() on legacy database

2009-06-19 Thread geraldcor
Ok, so I feel a bit silly, but it was because I had a column name in my db called Discount% and I am assuming the % is screwing it up. Now the question becomes how do I escape the % or do I have to rename my db column (please god not the latter as that would entail a whole mess of rewriting

Gettext needs iconv.dll but I only have libiconv2.dll

2009-06-19 Thread Joshua Russo
When I installed Libiconv (1.9.2) and gettext (0.13) on my XP Pro machine and tried to run makemessages it initially gave me an error message saying that it could not find iconv.dll. I went to the install directory and I had a libiconv2.dll but no iconv.dll. I tried copying and renaming the file

active django battery projects

2009-06-19 Thread notcourage
I for one would be interested in replies showcasing django battery projects underway. As a new django user, I'm stumbling on some active, useful projects (django piston, south) and wondering if there are projects addressing my wish list (django model cache, django parsed template cache, multi DB,

production sites powered by django

2009-06-19 Thread notcourage
http://www.djangosites.org/ is missing info like load, scaling techniques used, utilities written (e.g., custom tags, custom form fields, custom model fields, wish list. I don't see how one adds a site. I for one would be interested in replies to this post about production sites created

Re: My templates don't render correctly

2009-06-19 Thread Karen Tracey
On Fri, Jun 19, 2009 at 3:58 PM, mojo wrote: > > [snip] > in the "urls.py" file > ... > ... > (r'^work$', direct_to_template, {'template': 'work/f1_index.html'}), > (r'^work/w1/$', direct_to_template, {'template': 'work/subfold1/ > sub1_index.html'}), > ... > ... > > > when

Makemessages not finding strings in my templates?

2009-06-19 Thread Joshua Russo
I'm trying to use the makemessages command to create .po files and I'm running into a problem scanning .html files. I'm running XP Pro and using libiconv (1.9.2) and gettext (0.13). None of the {% trans 'text' %} entries are being picked up in the scan. I'm loading the I18n library in all of my

My templates don't render correctly

2009-06-19 Thread mojo
Does anyone know why django doesn't render pages with trailing slashes? I have a template that looks something like this: templates/ - _base.html - index.html - work/ - subfold1/ -sub1_index.html - subfold2/ - f1_index.html

Re: django-logging

2009-06-19 Thread eric.frederich
Thanks a bunch. I needed help telling me where to do these things. Putting it in settings.py seems to work. Do you think putting something like... logger = logging.getLogger(__name__) ...at the beginning of every file that will use logging will be a problem? I could always just use the root

Re: problem with umlaut in foreign key table

2009-06-19 Thread Karen Tracey
On Fri, Jun 19, 2009 at 12:18 PM, goobee wrote: > > hi > I run in problems with umlaute (äöü) with two related tables on a > postgres-DB > > class Rorg(models.Model): >rorgokbez = models.CharField(max_length=4, primary_key=True) >rorgobez =

Re: Filter with many_to_many returns duplicate results

2009-06-19 Thread Alex Gaynor
On Fri, Jun 19, 2009 at 12:25 PM, Facundo Casco wrote: > > Hi, I have a problem with a query and I think it might be a bug. > Lets say I want to get some Entries that have authors from a City. > I use a filter like with authors__city__name='Someville' > The problem is that I

Filter with many_to_many returns duplicate results

2009-06-19 Thread Facundo Casco
Hi, I have a problem with a query and I think it might be a bug. Lets say I want to get some Entries that have authors from a City. I use a filter like with authors__city__name='Someville' The problem is that I get one Entry for every Author that lives in 'Someville' and when one Entry has more

problem with umlaut in foreign key table

2009-06-19 Thread goobee
hi I run in problems with umlaute (äöü) with two related tables on a postgres-DB class Rorg(models.Model): rorgokbez = models.CharField(max_length=4, primary_key=True) rorgobez = models.CharField(max_length=30) def __unicode__(self): return "%s %s" % (self.rorgokbez,

IBM Dataservers backend support in Django application Framework.

2009-06-19 Thread Ambrish Bhargava
IBM Dataservers backend support in Django application Framework. - IBM DB2 backend support in Django application Framework is now available to the community. Right now it is in beta stage.

Re: Reverse lookups and chaining filters doesn't work

2009-06-19 Thread Alex Gaynor
On Fri, Jun 19, 2009 at 11:31 AM, IanR wrote: > > Seems to work fine if I build the query using Q's and then only use > filter one. > > On Jun 19, 11:33 am, IanR wrote: > > Anyone have any ideas? > > > > q2 and q3 should return the same results. > > >

Re: Reverse lookups and chaining filters doesn't work

2009-06-19 Thread IanR
Seems to work fine if I build the query using Q's and then only use filter one. On Jun 19, 11:33 am, IanR wrote: > Anyone have any ideas? > > q2 and q3 should return the same results. > > >>> from testing.models import Building > >>> from testing.models import Unit > >>>

Re: Please help me give mod_wsgi to function as runserver

2009-06-19 Thread James Gregory
The documentation for this possibility is here: http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode James On Jun 19, 3:16 pm, murd3r1ch wrote: > 1. When I edit my files (views.py, urls.py etc) runserver used to > restart to  reflect changes but apache/mod_wsgi does

Windows live contacts API - code sample for Django

2009-06-19 Thread dubkov
If anyone is struggling with importing contacts from Hotmail like I was - here's the code that works. @login_required def hotmail_login(request): from lib.WindowsLiveLogin import WindowsLiveLogin wll = WindowsLiveLogin(appid=settings.WINDOWS_APPID, secret=settings.WINDOWS_SECRET,

Problem in setting 'class' attribute to the widget CheckboxSelectMultiple

2009-06-19 Thread Avinash
I've been working on a form which displays a list of selected checkboxes.I wanted to apply CSS to that that list of checkboxes.I was using the CheckboxSelectMultiple widget to override my default form widget.I used, object = forms.MultipleChoiceField(label=''My_label",

Please help me give mod_wsgi to function as runserver

2009-06-19 Thread murd3r1ch
1. When I edit my files (views.py, urls.py etc) runserver used to restart to reflect changes but apache/mod_wsgi does not --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Reverse lookups and chaining filters doesn't work

2009-06-19 Thread IanR
Anyone have any ideas? q2 and q3 should return the same results. >>> from testing.models import Building >>> from testing.models import Unit >>> b1 = Building(name="Bld 1") >>> b1.save() >>> u1 = Unit(building=b1,bedrooms=1,bathrooms=1) >>> u1.save() >>> u2 =

Re: Preset foreign key in Model Form

2009-06-19 Thread Daniel Roseman
On Jun 19, 1:36 am, adelaide_mike wrote: > Try again.  I am new to Django and the web, so I do not know all the > right vocabulary.  Sorry. > > I need my ModelForm to be displayed, for creation of a new record, > with a date field and a foreign key (pointing to the

Django Sites -> Users

2009-06-19 Thread TheMaTrIx
I don't find the functionality in the admin interface, so I'm guessing its not implemented in the trunk. I thought that maybe it would be a handy thing to extend the sites framework into the users and groups framework. For my firm, we have several branches which run mostly the same website (all

Re: how do I show a non-editable field in the admin site

2009-06-19 Thread Ernst Bunders
Thank you, Ankit This is exactly what i need. I'll try it out. regards, Ernst On Fri, Jun 19, 2009 at 1:45 PM, ankit rai wrote: > hello, > > save this code in a file (python file) in your project and import this in > admin.py were u want the readonly field.modify > class

Re: Trouble with a django snippet FieldAccessForm (per-field user access for forms derived from models)

2009-06-19 Thread Rama Vadakattu
i could not able to understand the problem... after reading one i can quickly tell is you are not passing keyword arguments so kwargs will be always empty please look at the belowlink for more information: http://www.saltycrane.com/blog/2008/01/how-to-use-args-and-kwargs-in-python/ On

Re: django-logging

2009-06-19 Thread Rama Vadakattu
I usually use the python logging facility for doing logging in django Any way the below is code i write -- i hope you can figure out what is happening here 1. Prepare logging conf file and name it as logging.conf and put under project directory Here goes the typicall

Re: how do I show a non-editable field in the admin site

2009-06-19 Thread ankit rai
hello, save this code in a file (python file) in your project and import this in admin.py were u want the readonly field.modify class Mymodel(admin.ModelAdmin): to class Mymodel(ReadOnlyAdminFields,admin.ModelAdmin). and inside ur admin.py below fields wirte readonly

Re: Preset foreign key in Model Form

2009-06-19 Thread Rama Vadakattu
i think ForiegnKey uses ChoiceField as it has to display n number of choices. How should we intialize choice field? --- it should in this form source = [(actual value,display value),(actual value,display value) ]

Re: django development addons

2009-06-19 Thread Mike Ramirez
On Friday 19 June 2009 01:49:24 am Lakshman Prasad wrote: > Hi, > django-debug-toolbarmaster> > > I > haven't exactly tried all of these. I would like to know some > interesting use cases or blog posts of > people who use them. > I enjoy

Re: Should this be its own app?

2009-06-19 Thread Mike Ramirez
On Thursday 18 June 2009 06:07:59 pm Wiiboy wrote: > Right. > > I was wondering what would be best. Would it make sense to have that > be it's own app? > I've found that's whats best is what is best for you and those who will be maintaining it. If you don't know what's best, you should

Re: Should this be its own app?

2009-06-19 Thread Chris Withers
Kenneth Gonsalves wrote: > I personally would put everything in one app at the start. If things start to > grow and you want to reuse that part in another project, or release it to the > public (and become famous), then it makes sense to factor it out into a > separate app - maybe a separate

Re: Why why why not write a search module for Django user?

2009-06-19 Thread Shuge Lee
I got it On Jun 18, 5:36 pm, Daniel Roseman wrote: > On Jun 18, 9:39 am, Shuge Lee wrote: > > > Search is used in most of CMS, > > for avoid re-invent the wheel, please provider a search engine module. > > http://haystacksearch.org/ > > Django is

Re: how do I show a non-editable field in the admin site

2009-06-19 Thread Ernst Bunders
hello thanks for your reply, but it is a bit to brief for me. I looked reedonlyadmin up in google and the only thing i find is http://code.djangoproject.com/wiki/ReadOnlyAdmin, which is a proposal. So: i guess this has been implemented, but it is not documented in the online documentation. So

django development addons

2009-06-19 Thread Lakshman Prasad
Hi, I have come across various development add ons, particularly, django-extensions django-annoying

Re: Ajax with JSON-RPC -- new Django handler

2009-06-19 Thread lkcl
ok, i added a copy of the code to the wiki page, as some people may find that easier to access and evaluate rather than from some other random google group page. l. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: django-navbar

2009-06-19 Thread greatlemer
On Jun 18, 5:56 pm, Lars Stavholm wrote: > Has anyone been able to use django-navbar successfully > in latest Django 1.1 (from trunk)? > > Any ideas on how to use it appreciated. > > Or maybe there's a better navigation bar plugin? > > /Lars Stavholm I would say the

Re: One to Many+foreign key Query: best way to build the optimal result

2009-06-19 Thread BenW
I'm not sure I completely understand the problem, but I'll give it a stab: events = Event.objects.filter(start__gte=datetime.today()) locations = Location.objects.filter(location__in=events) results = [ {'start': loc.location.start, 'title': loc.location.title, 'id': loc.location.id,