Re: Textarea taking htnml tags

2015-03-29 Thread Akash Patni
*Hi,* *This my template* {% block content %} View Notes See your notes details. {% for i in result %} Note Title {{i.note_title}} Note *{{i.note}}* Beneficiaries {% if all_nominees %} {% for nominee in all_nominees

Re: Multiple Django projects using the same database

2015-03-29 Thread Russell Keith-Magee
On Mon, Mar 30, 2015 at 10:20 AM, Ien C. wrote: > Thanks Russ! > > Good point about the validation logic. Will definitely keep that in mind. > And yes, my basic approach here is the same code base working on different > subsets of data by default, with the ability for data to be optionally > "see

Re: Multiple Django projects using the same database

2015-03-29 Thread Ien C.
Thanks Russ! Good point about the validation logic. Will definitely keep that in mind. And yes, my basic approach here is the same code base working on different subsets of data by default, with the ability for data to be optionally "seen" by both sites as needed. One more question: there's n

Upgrade to django 1.7- ImproperlyConfigured -Tastypie label duplicate? help

2015-03-29 Thread amarshall
Hi, So I updated my django project from django 1.6 to 1.7.7 and when I run "python manage.py migrate" I get this error stating that I have a duplicate label. Here's the traceback Creating tables... Installing custom SQL... Installing indexes... Running migrations: Applying tastypie.0

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
On 30/03/2015 3:11 AM, Melvyn Sopacua wrote: On Sunday 29 March 2015 22:04:23 Mike Dewhirst wrote: On 29/03/2015 7:28 PM, Julo wrote: Maybe you can add an interface for the models that are importants and hook to the save/delete signal a interfaced function called CanSave() And you check the pre

Re: sidebar menu appears with every click on the main menu item before it disappears

2015-03-29 Thread Behee Trimble
Thanks very much for your reply. You are right - it is much easier if I had to write the code myself. I am kind of doing the same and I see the repetition but when I try to eliminate the duplicates the program breaks!! Thanks again Beheen On Sunday, March 29, 2015 at 6:16:04 PM UTC-4, Mike Dew

Re: Multiple Django projects using the same database

2015-03-29 Thread Russell Keith-Magee
On Mon, Mar 30, 2015 at 12:14 AM, Ien C. wrote: > Hi everyone, > > I'm hoping to confirm my understanding on how to deploy multiple Django > websites using the same database, using postgres and gunicorn/nginx. > > Doing this seems to me as simple as: > 1. Creating a copy of the Django project in

Re: sidebar menu appears with every click on the main menu item before it disappears

2015-03-29 Thread Mike Dewhirst
On 30/03/2015 2:13 AM, Behee Trimble wrote: Any body out there to give me a clue about my problem? Please? On Saturday, March 28, 2015 at 7:08:23 PM UTC-4, Behee Trimble wrote: Please help me to detect this problem: sidebar menu appears with every click on the main menu item. I in

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
On 30/03/2015 2:06 AM, Ezequiel wrote: On Sunday, March 29, 2015 at 5:08:06 AM UTC-3, Mike Dewhirst wrote: A perhaps better solution would be to disable the Save and Delete widgets/actions in particular circumstances. How can I do something like this? The quick&dirty way I did th

Re: Jinja2 with Django 1.8c1 & cannot import name 'Environment'

2015-03-29 Thread Simon Charette
Hi Rolf, Django 1.8+ adds built-in support but doesn't ship with Jinja2, the same way it has built-in support for PostgreSQL but doesn't ship the psycopg2 package. You must install it in your environment just like you did with the Django package. Simon Le dimanche 29 mars 2015 16:40:33 UTC-

Re: Jinja2 with Django 1.8c1 & cannot import name 'Environment'

2015-03-29 Thread Rolf Brudeseth
Hello Simon, > Did you install jinja2 in > your python environment (I assumed /www/pbs-venv was a virtualenv)? > No, Jinja2 is integrated into Django 1.8c1. https://docs.djangoproject.com/en/dev/releases/1.8/ - I am using pyvenv which is integrated

Re: Jinja2 with Django 1.8c1 & cannot import name 'Environment'

2015-03-29 Thread Simon Charette
Hi Rolf, Did you install jinja2 in your python environment (I assumed /www/pbs-venv was a virtualenv)? What does /www/pbs-venv/bin/pip --freeze outputs? Simon Le dimanche 29 mars 2015 14:53:49 UTC-4, Rolf Brudeseth a écrit : > > >> Rename your jinja2

Re: Jinja2 with Django 1.8c1 & cannot import name 'Environment'

2015-03-29 Thread Rolf Brudeseth
> > > Rename your jinja2.py file something else and things should be working. > > I am having some problems wrapping my head around how to implement this. When I rename the file I created to something arbitrary I get: Exception Value: No module named 'jinja2' Exception Location: /www/pbs-

Re: How to mock a model backend

2015-03-29 Thread Alejandro Varas G.
Hi Sven, You can mock the call to the external service like this. @mock.patch.object(MyModelBackend, 'authenticate') # First the class of your model backend. Then the method you want to mock. def test_something_that_uses_login(self, mock_authenticate): # The mock object is passed to your

Multiple Django projects using the same database

2015-03-29 Thread Ien C.
Hi everyone, I'm hoping to confirm my understanding on how to deploy multiple Django websites using the same database, using postgres and gunicorn/nginx. Doing this seems to me as simple as: 1. Creating a copy of the Django project in its own directory, with its own settings.py etc. 2. Keep th

Re: Django system check gives error when storing method in variable

2015-03-29 Thread Wouter Miltenburg
Hi Markus, That explains it :), will change the code. Not really sure why that line is there to be honest. The original version of that code was developed by someone else and this is just the version that is compatible with Python 3. Don't really see dependencies in the code itself that uses t

Re: Inserting literal % sign in QuerySet.extra()

2015-03-29 Thread Tim Graham
No, it won't. See https://docs.djangoproject.com/en/dev/internals/release-process/#supported-versions for the guidelines on which changes are backported. On Saturday, March 28, 2015 at 2:49:21 AM UTC-4, Gergely Polonkai wrote: > > Great, thank you! > > Although I'm more than willing to upgrade,

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Melvyn Sopacua
On Sunday 29 March 2015 22:04:23 Mike Dewhirst wrote: > On 29/03/2015 7:28 PM, Julo wrote: > > Maybe you can add an interface for the models that are importants > > and hook to the save/delete signal a interfaced function called > > CanSave() And you check the premisson he has, if not allowed rais

Re: Django system check gives error when storing method in variable

2015-03-29 Thread Markus Holtermann
Hey Wouter, since Django 1.7 Model.check() is a reserved method that is used by the system checks framework (https://docs.djangoproject.com/en/1.7/topics/checks/#field-model-and-manager-checks). The cleanest way is to remove that line (check = is_paid). Why do you have that in the first place

Django system check gives error when storing method in variable

2015-03-29 Thread Wouter Miltenburg
Hi all, Haven't used Django 1.7.7 till today, but whenever I want to launch my project I get the following error: ERRORS: gopro.MyPayment: (models.E020) The 'MyPayment.check()' class method is currently overridden by . I use another django app (https://github.com/wmiltenburg/django-mollie-ideal)

Re: sidebar menu appears with every click on the main menu item before it disappears

2015-03-29 Thread Behee Trimble
Any body out there to give me a clue about my problem? Please? On Saturday, March 28, 2015 at 7:08:23 PM UTC-4, Behee Trimble wrote: > > Please help me to detect this problem: sidebar menu appears with every > click on the main menu item. > > I inherited a Django app and I am trying to learn it.

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Ezequiel
On Sunday, March 29, 2015 at 5:08:06 AM UTC-3, Mike Dewhirst wrote: > > A perhaps better solution would be to disable the Save and Delete > widgets/actions in particular circumstances. > > How can I do something like this? The quick&dirty way I did this was: In settings.py create a tuple indi

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
On 29/03/2015 9:22 PM, Gabriel - Iulian Dumbrava wrote: In case you hide/not display the save/delete button you must also double check in the delete view if the current user has the right permissions to delete the item. It's pretty easy to add a post button in firebug, or even trigger the post us

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
On 29/03/2015 7:09 PM, Avraham Serour wrote: maybe overwrite the view in your own modeladmin class? I need to keep using the Admin and haven't done anything like that previously. I'll have to do the research. Thanks Mike On Sun, Mar 29, 2015 at 11:07 AM, Mike Dewhirst mailto:mi...@dewhir

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
On 29/03/2015 7:28 PM, Julo wrote: Maybe you can add an interface for the models that are importants and hook to the save/delete signal a interfaced function called CanSave() And you check the premisson he has, if not allowed rais an exception, and don't save. Julo I like that. I'll dig a bi

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Gabriel - Iulian Dumbrava
In case you hide/not display the save/delete button you must also double check in the delete view if the current user has the right permissions to delete the item. It's pretty easy to add a post button in firebug, or even trigger the post using a different method. duminică, 29 martie 2015, 11:0

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Julo
Maybe you can add an interface for the models that are importants and hook to the save/delete signal a interfaced function called CanSave() And you check the premisson he has, if not allowed rais an exception, and don't save. Sorry for the bad english. Saludos, Julian -Original Message-

Re: How to prevent save/delete in the Admin

2015-03-29 Thread Avraham Serour
maybe overwrite the view in your own modeladmin class? On Sun, Mar 29, 2015 at 11:07 AM, Mike Dewhirst wrote: > At the moment "has_change_permission" in the Admin works by returning > 403 Forbidden if it gets a False. > > That doesn't suit my needs but it is probably not advisable to adjust it.

How to prevent save/delete in the Admin

2015-03-29 Thread Mike Dewhirst
At the moment "has_change_permission" in the Admin works by returning 403 Forbidden if it gets a False. That doesn't suit my needs but it is probably not advisable to adjust it. Users without change permission need to be able to see the data and perhaps raise an exception (in this case BusinessR