Re: User .get_all_permissions() vs. .has_perm() inconsistency

2012-02-10 Thread Andy McKay
On Fri, Feb 10, 2012 at 4:01 PM, dslowik wrote: u.get_all_permissions() > set([u'wb.delete_libraryitem', u'wb.change_libraryitem']) u.has_perm("wb.change_libraryitem") > True > > ...Shouldn't that be False? Why would it be False? get_all_permissions: Returns a set of permission strings

Re: Generating a list of available templates

2012-02-10 Thread Patrick Wellever
Thanks for the reply. Yes, this wouldn't be too tough if the directories in TEMPLATE_DIRS were all I had to worry about, but the glitch I mentioned earlier is that Django can also look for templates in places other than those listed explicitly in that setting. For example, the template loader

User .get_all_permissions() vs. .has_perm() inconsistency

2012-02-10 Thread dslowik
Here is the code form my Python 2.6.6 session which is puzzling me: >>> from django.contrib.auth.models import User >>> u = User.objects.get(username='clint') >>> u.get_all_permissions() set([u'wb.delete_libraryitem', u'wb.change_libraryitem']) >>> u.has_perm("wb.change_libraryitem") True ...Shou

Re: Generating a list of available templates

2012-02-10 Thread Bill Beal
I know nothing, but here's what I did: python manage.py shell import os from settings import TEMPLATE_DIRS for x in TEMPLATE_DIRS: print x os.listdir(x) It gave me a list of the files in the (each) template directory. It looks like you already have a list of template directories in settings.

Re: Generating a list of available templates

2012-02-10 Thread Patrick Wellever
Sorry... I think that's a little more complicated than what I need, actually. Django already handles searching for the template in all the right locations, so I don't have any problem actually rendering the template, and I shouldn't need to worry about absolute paths. Here's a simplified bit of cod

Re: Generating a list of available templates

2012-02-10 Thread Python_Junkie
I think I just figured out what you want to do. You want one drop down list with all of the templates listed regardless of which folder the template lives in. So, as describe above you would create a dictionary of template_names by walking through the directories where the templates live and pass

Re: Generating a list of available templates

2012-02-10 Thread Patrick Wellever
Thanks -- you must be on your way out the door now so I won't call, but according to your area code it looks like we might be neighbors. ;) So following the syntax I wrote out, what I still need to know is how do I get to EVERY_DIRECTORY_DJANGO_LOOKS_FOR_TEMPLATES_IN. That's a variable that represe

Re: Generating a list of available templates

2012-02-10 Thread Python_Junkie
I think you have it with the syntax you just wrote down. I will be available by phone until 4:45 if you want to call. 781-248-6557 On Feb 10, 4:19 pm, Patrick Wellever wrote: > Sorry, this question is turning out to be much more difficult to articulate > than I originally expected. Thanks for b

Re: Generating a list of available templates

2012-02-10 Thread Patrick Wellever
Sorry, this question is turning out to be much more difficult to articulate than I originally expected. Thanks for bearing with me. ;) You definitely have the right idea of what I'm trying to do -- the only problem with this method is that Django looks for templates in multiple places, so I don't

Re: Generating a list of available templates

2012-02-10 Thread Python_Junkie
The internet is a wonderful invention, but sometimes the interchange of the spoken word is more efficient. Let's see if I have this straight. You know which directory the templates are in. 'templates/flatpages/page_templates/ for example. Is that correct? Then when you pass from the url.py to

Re: Generating a list of available templates

2012-02-10 Thread Demetrio Girardi
On 10 Feb 2012 at 14:50, Patrick Wellever wrote: > I want to make it a choice field that justs lists all the files in, for > example, > 'templates/flatpages/page_templates/', so the user can see what templates are > available and just > choose one from a select list. you can read the filesyst

Re: Generating a list of available templates

2012-02-10 Thread Patrick Wellever
Sorry to be unclear... Basically the functionality I want is just like in contrib.flatpages -- the model has a field called 'template' that allows the user to specify an alternate template for the object detail page. But in the flatpages app, the field is just a charfield, so the user has to kn

Re: Generating a list of available templates

2012-02-10 Thread Python_Junkie
I am not sure that I follow you. When you mention creating new templates (you would be creating these dynamically?) and have them show up in your database (model?) Please explain or provide an example On Feb 10, 1:45 pm, Patrick Wellever wrote: > Right, I understand the loader works this way…

Re: Generating a list of available templates

2012-02-10 Thread Patrick Wellever
Right, I understand the loader works this way… What I'm trying to do is generate a list of 'choices' for a model field that populates itself automatically with available templates in a given directory, that works regardless of whether the specified directory is on a template path specified in t

Re: Generating a list of available templates

2012-02-10 Thread Python_Junkie
https://docs.djangoproject.com/en/dev/ref/templates/api/ Search on template loaders and this url will explain it. The following is from this url django.template.loaders.app_directories.Loader Loads templates from Django apps on the filesystem. For each app in INSTALLED_APPS, the loade

Re: Generating a list of available templates

2012-02-10 Thread Patrick Wellever
Thanks, I think that gets me most of the way there, but the part I'm having more trouble with is figuring out how to deal with the other template loaders, such as 'django.template.loaders.app_directories.Loader', that don't pull from the 'TEMPLATE_DIRS' setting. I'd like the solution to take tho

Re: Generating a list of available templates

2012-02-10 Thread Python_Junkie
The setttings file is a python module. See page https://docs.djangoproject.com/en/dev/topics/settings/ Since the path is set for the templates. *** frrom the example TEMPLATE_DIRS = ('/home/templates/mike') in the view templates=os.listdir(TEMPLATE_DIRS) ###template_count=len(t

Re: Generating a list of available templates

2012-02-10 Thread Micky Hulse
On Fri, Feb 10, 2012 at 6:40 AM, Patrick Wellever wrote: > I guess the main question is, is there some function I can use to return a > directory on the template path? I'm interested in this also. I too have my own static pages app and have always thought it would be easier for folks to choose f

Re: [Error] Mixing Two databases

2012-02-10 Thread Subhodip Biswas
Hi, On Fri, Feb 10, 2012 at 7:27 PM, Dennis Lee Bieber wrote: > On Fri, 10 Feb 2012 09:32:02 +0530, Subhodip Biswas > wrote: > > >         >>I am getting a error like this : >>django.db.utils.DatabaseError: Ordering can't span tables on >>non-relational backends >> >        You don't, by some

Re: Creating a hospital erp (hospital management) in Django

2012-02-10 Thread Alec Taylor
On Fri, Feb 10, 2012 at 9:58 PM, Saadat wrote: > Hello All, > I'm in my final year of computer science engineering and for my final > year project, i'm creating a hospital erp. I'm a bit confused about > where to start from. Any sort of help will be appreciated. Thanks a > lot. > > Cheers > Saadat

Re: how do I model an auto-populate name from admin authorised users list

2012-02-10 Thread K.C. Smith
You have a lot of big questions and you'll need to do some more learning of and practice Django to answer them all. But, I will try to answer some and point you in the right direction. First, you linked a snippet of what seems to be your "models.py" file, but much of what you wish to do will prob

Generating a list of available templates

2012-02-10 Thread Patrick Wellever
Hi all, An app I'm working on has a model that, similar to the Flatpages app model, has a "template" field to allow users to specify an alternate template for displaying the object detail view. What I'd like to do though is to make this a choice field that pulls its options dynamically from a

Re: how to make a small change for apps installed under /site-packages dir

2012-02-10 Thread Tom Evans
On Mon, Feb 6, 2012 at 8:23 AM, bruno desthuilliers wrote: > Depends on how much you need to modify the third part app. Forking the > app is sometimes the best solution, but it means you'll have a hard > time keeping in sync with the original code when bugfixes and new > features will be released.

Re: regarding an error in settings.py

2012-02-10 Thread kalyani ram
i am not able to attach the screen shots. i will mail it to you. On Feb 10, 4:35 pm, Stanwin Siow wrote: > can you show the actual error output? > > Best Regards, > > Stanwin Siow > > On Feb 10, 2012, at 4:58 PM, kalyani ram wrote: > > > > > > > > > Thank you very much. I managed to come out of

Re: Creating a hospital erp (hospital management) in Django

2012-02-10 Thread Python_Junkie
Is the project referenced in this link written in Django. Was your goal for your class project to write a Django app? On Feb 10, 8:27 am, Richard House wrote: > Hi Saadat, > Rather than creating something new, have you looked at contributing to > software from such lists like > this?http://e

Re: Creating a hospital erp (hospital management) in Django

2012-02-10 Thread Patricio Valarezo
El 10/02/12 8:26, Python_Junkie escribió: I had not completed my previous post, and hit the send button by mistake. One wire frame work is http://www.balsamiq.com/products/mockups/manifesto And you can download a free trial. If you search on Frameworks then you will find a number of others tha

Re: Thread local storage issue under Apache

2012-02-10 Thread Alessandro Candini
On 02/10/2012 01:11 PM, Tom Evans wrote: On Fri, Feb 10, 2012 at 11:00 AM, Alessandro Candini wrote: Hi everyone. … But if I run the same application under the Apache web server, I get the following error: Fatal Python error: Couldn't create autoTLSkey mapping … I'm using Apache/2.2.20 on U

Re: how do I model an auto-populate name from admin authorised users list

2012-02-10 Thread Krondaj
Can anybody help me here??? On Feb 3, 9:40 am, Krondaj wrote: > Hi, > > I have written a model for a web form (of sorts) I'm making that > people can fill in from the admin site.  I have set permissions from > the admin end so they can only write or change new posts of the form > (seehttp://dpast

Re: Creating a hospital erp (hospital management) in Django

2012-02-10 Thread Richard House
Hi Saadat, Rather than creating something new, have you looked at contributing to software from such lists like this? http://en.wikipedia.org/wiki/List_of_open-source_healthcare_software Regards, Richard On 10 Feb 12, at 10:58, Saadat wrote: > Hello All, > I'm in my final year of computer scien

Re: Creating a hospital erp (hospital management) in Django

2012-02-10 Thread Python_Junkie
I had not completed my previous post, and hit the send button by mistake. One wire frame work is http://www.balsamiq.com/products/mockups/manifesto And you can download a free trial. If you search on Frameworks then you will find a number of others that are open source, or you can simply use yel

Re: https://code.djangoproject.com/ticket/16909

2012-02-10 Thread Sandro Dutra
[...]Django 1.4, scheduled for March 2012.[...] from https://docs.djangoproject.com/en/dev/releases/1.4-alpha-1/ 2012/2/10 Craig Blaszczyk : > Hi All, > > I need the bugfix from this ticket. This ticket is assigned to Version 1.3, > and was closed as fixed 5 months ago. This was fixed after the 1

Re: Creating a hospital erp (hospital management) in Django

2012-02-10 Thread Python_Junkie
Not sure from your post, which piece you are stuck on. 1. Have you used Django before? If not start with the tutorial https://www.djangoproject.com/ 2. If you have a basic understanding of Django, have you been able to set up a basic project /app and connect run syncdb. One can always connect to

Re: Creating a hospital erp (hospital management) in Django

2012-02-10 Thread adesantoasman
Hello, nice thread. **tagged to keep following.. +adesst -Original Message- From: Saadat Sender: django-users@googlegroups.com Date: Fri, 10 Feb 2012 02:58:16 To: Django users Reply-To: django-users@googlegroups.com Subject: Creating a hospital erp (hospital management) in Django He

Creating a hospital erp (hospital management) in Django

2012-02-10 Thread Saadat
Hello All, I'm in my final year of computer science engineering and for my final year project, i'm creating a hospital erp. I'm a bit confused about where to start from. Any sort of help will be appreciated. Thanks a lot. Cheers Saadat -- You received this message because you are subscribed to t

Re: Custom times in admin time selector

2012-02-10 Thread Tom Evans
On Wed, Feb 8, 2012 at 2:15 PM, Sebastian Goll wrote: > Hi all, > > For DateTimeFields, the admin presents selector widgets for both the > date and time form fields. The default choices for the time selector > are: Now, Midnight, 6 a.m., Noon. > > I'd like to replace those default choices with som

Re: regarding an error in settings.py

2012-02-10 Thread Python_Junkie
The name field is the database name. You always need to create an empty database for any new implementation. Have you created a database and can you attach to it with the credentials that are supplied in the settings.py file On Feb 10, 6:35 am, Stanwin Siow wrote: > can you show the actual erro

Re: Is it possible to implement an ODBC for Django

2012-02-10 Thread Python_Junkie
Thanks for your response, but that was not exactly what I was looking for. I use pyodbc module for all of my sql connections through python in general. It is very powerful. But it does not allow me to configure the settings.py file for an ODBC connection I wanted to how I would implement ODBC thr

Re: QuerySet and subselect

2012-02-10 Thread Oleg Korsak
Yeah, you are right. Actually I'm trying to get most actual (latest by timestamp) records per group. 2012/2/10 Dennis Lee Bieber : > On Fri, 10 Feb 2012 02:39:33 +0200, ?? > wrote: > >>Is it possible to write ORM-way request to be same as this SQL: >>SELECT mo.* FROM (SELECT mi.* FROM my

Re: Thread local storage issue under Apache

2012-02-10 Thread Tom Evans
On Fri, Feb 10, 2012 at 11:00 AM, Alessandro Candini wrote: > Hi everyone. > > … > > But if I run the same application under the Apache web server, I get the > following error: > Fatal Python error: Couldn't create autoTLSkey mapping > >… > > I'm using Apache/2.2.20 on Ubuntu-11.10 mod_wsgi-3.3 Py

https://code.djangoproject.com/ticket/16909

2012-02-10 Thread Craig Blaszczyk
Hi All, I need the bugfix from this ticket. This ticket is assigned to Version 1.3, and was closed as fixed 5 months ago. This was fixed after the 1.3.1 release. Is there going to be a 1.3.2 release which includes this fix? Cheers, --Craig Blaszczyk -- You received this message because you a

Re: Multiple Django Virtual Hosts on Apache+mod_wsgi but only one gets served

2012-02-10 Thread Tom Evans
On Tue, Feb 7, 2012 at 12:55 AM, Chris Cuilla wrote: > I've been struggling to figure out the following problem and am hoping > someone else has seen this. > > I have a server running Apache 2 w/mod_wsgi. I've setup multiple, > different Django apps. Each has its own virtual host configuration > (

Re: regarding an error in settings.py

2012-02-10 Thread Stanwin Siow
can you show the actual error output? Best Regards, Stanwin Siow On Feb 10, 2012, at 4:58 PM, kalyani ram wrote: > Thank you very much. I managed to come out of this error and ended up > with a new one. > I get an error saying that the Name field is wrong. If i have not > mistaken, should th

Thread local storage issue under Apache

2012-02-10 Thread Alessandro Candini
Hi everyone. I have a django project in where I've added a custom .py file which launches a shell command (a GDAL utility to manipulate shapefiles): subprocess.call(["ogr2ogr", "-t_srs", "EPSG:900913", shpGoogle, shpOrig]) If I run the function containing this command using django web server

Re: email feature

2012-02-10 Thread kalyani ram
i ll have a forward button which when clicked will forward the MSG to the recipient and add the message to the queue named "forward". This queue should work using the django_cron package. On Feb 10, 1:56 pm, kalyani ram wrote: > Hey all, > > I am trying to include a new feature to my email tool,

Re: Is it possible to implement an ODBC for Django

2012-02-10 Thread Renne Rocha
Try: http://pyodbc.sourceforge.net/ and http://code.google.com/p/django-pyodbc/ Renne Rocha http://rennerocha.com/ On Fri, Feb 10, 2012 at 1:29 AM, Python_Junkie < software.buy.des...@gmail.com> wrote: > I wanted to know if the settings.py will support a generic ODBC > connection and

Re: regarding an error in settings.py

2012-02-10 Thread kalyani ram
Thank you very much. I managed to come out of this error and ended up with a new one. I get an error saying that the Name field is wrong. If i have not mistaken, should the name filed be the table name ? or is it something new? thanks in advance. On Feb 9, 7:30 pm, Stanwin Siow wrote: > Hi > > Y

email feature

2012-02-10 Thread kalyani ram
Hey all, I am trying to include a new feature to my email tool, which is used for forwarding the mail to the appropriate user and storing it in a separate queue using django_cron. Can someone tell me how to do this. It would be very help as i have limited idea on django. thanks in advance -- You

Re: Contribute to Django

2012-02-10 Thread Gath
Sorry, had not seen that! Thanks. On Feb 9, 10:19 pm, yati sagade wrote: > Django docs explain this quite nicely :) > > https://docs.djangoproject.com/en/dev/internals/contributing/?from=ol... > > > > > > > > > > On Fri, Feb 10, 2012 at 12:46 AM, Gath wrote: > > Guys, > > > What do i need to le