selected admin actions for a user, who is owner of one of the tenants in a multi tenant django crm app

2013-06-19 Thread Andrew Stewart
Hi Group, could someone please help me with - http://stackoverflow.com/questions/17184386/providing-admin-actions-to-group-members-in-a-multi-tenant-django-crm-applicatio Thanks! -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Re: Model Error

2013-06-19 Thread jirka . vejrazka
Hi Nigel, You have a spelling error in the word "unicode" in the TextFile method. Cheers Jirka -Original Message- From: Nigel Legg Sender: django-users@googlegroups.com Date: Wed, 19 Jun 2013 06:51:21 To: Reply-To:

Re: m2m_changed signal registration

2013-06-19 Thread Roberto López López
Btw I have opened a stackoverflow thread: http://stackoverflow.com/questions/17149305/post-save-signal-and-relations At the beginning I was thinking of using a post_save signal, but an user there suggested me to better use the m2m_changed. On 06/18/2013 04:12 PM, Roberto López López wrote: >

Re: Model Error

2013-06-19 Thread Nigel Legg
Thank you. Not seeing it for staring at it for too long. Regards, Nigel Legg 07914 740972 http://twitter.com/nigellegg http://uk.linkedin.com/in/nigellegg On 19 June 2013 07:53, wrote: > ** > Hi Nigel, > > You have a spelling error in the word "unicode" in the

Re: export .csv file from database

2013-06-19 Thread Derek
>From just a quick glance, I have probably missed complex here - but one option to try is changing the delimiter from a comma to another character (e.g. a semi-colon) - see: http://docs.python.org/2/library/csv.html#dialects-and-formatting-parameters (But its also possible that in all the

Django-Tastypie with mongoengine problem in uploading images to GridFS

2013-06-19 Thread Hélio Miranda
Hi! I have an application (Django-Tastypie-mongoengine) in which I am uploading images to GridFS. With the previous version of tastypie and mongoengine was working properly. As I was doing the following to upload: *def upload (request, id):* * Movie.objects movie = (id = id)* * * * if

Re: Problem when creating a form for adding users to groups

2013-06-19 Thread Derek
I think the problem is that you are using queries which are in the form: (id = some_list_of_items) and you cannot do that. Have a look at the "_in" syntax: https://docs.djangoproject.com/en/dev/ref/models/querysets/#in (That whole document is very useful one to read and understand; as making

Re: Model Error

2013-06-19 Thread Ange BOUABLE
Hi Legg, In your TextFile class, the name of your __unicode__ method is wrong. You wrote def __unicde__(self): instead of def __unicode__(self):. I think that's the issue. Regards, ** *Ange Bouablé 06 16 86 92 01* ** * * *"Là où la volonté

readonly_fields

2013-06-19 Thread tony gair
I have tried to use readonly_fields in a form to designate fields that the user is not allowed to change. class Meta readonly_fields = [user] e.g. However when I show the form the user can edit them.doh, btw I do want to display, but not to edit! -- You received this message

Re: readonly_fields

2013-06-19 Thread Timster
Where are you setting that? readonly_fields is for ModelAdmin when you are working with the admin app. If you want to do it in a normal form, you will need to set readonly attribute on the widget. -- You received this message because you are subscribed to the Google Groups "Django users"

File wsgi.py identify SO

2013-06-19 Thread Hélio Miranda
Hi I wonder if someone can help me. My problem is the following: in my file wsgi.py django, I wish I could make a condition if OS is windows running sys.path.append (...) if linux runs sys.path.append ('...') Is this possible? How do I identify the OS? -- You received this message because you

Re: File wsgi.py identify SO

2013-06-19 Thread Gustavo Carneiro
On Wed, Jun 19, 2013 at 2:29 PM, Hélio Miranda wrote: > Hi > I wonder if someone can help me. > My problem is the following: > in my file wsgi.py django, I wish I could make a condition if OS is > windows running sys.path.append (...) if linux runs sys.path.append ('...') > >

Re: readonly_fields

2013-06-19 Thread tony gair
Ah thanks that explains that I'll look into changing the readonly attribute on the widget, is there a list of widgets do you know as some of these are choice fields i.e. non text and non integer fields On Wed, Jun 19, 2013 at 1:26 PM, Timster wrote: > Where are you

Having an issue with Minimal File Upload utility

2013-06-19 Thread Matt Lind
I am trying to get this utility to work within my own Django site: https://github.com/doph/minimal-django-file-upload-example/tree/master/src/for_django_1-3/myproject I have copied all the appropriate files to where they need to be. I am on django 1.3.7 on Centos 6.4 64Bit. When I run the

Passing parameters via POST in django 1.5

2013-06-19 Thread o_r
Hi, We're upgrading our application from 1.3 to 1.5. We have quite a few rest apis in our application. This used to work in 1.3: Url: /path/to/api Passing parameters in the body like this: =someValue=otherValue but it doesn't in 1.5, request.POST is empty in the view. I've tried both via a

Re: Passing parameters via POST in django 1.5

2013-06-19 Thread Anderson
if the parameters are in the URL the correct is request.GET https://docs.djangoproject.com/en/dev/ref/request-response/ On Wed, Jun 19, 2013 at 8:09 AM, o_r wrote: > Hi, > > We're upgrading our application from 1.3 to 1.5. We have quite a few rest > apis in our

Re: File wsgi.py identify SO

2013-06-19 Thread Hélio Miranda
I was trying this: *if os.name == 'nt':* *sys.path.append('c:/Projectos/Test/') # Windows* *else:* *sys.path.append('/srv/django/OnPitch/') # other (unix)* doing so, looking at the link that you send will not give *if sys.platform('win32'):* *sys.path.append('c:/Projectos/Test/') #

Re: File wsgi.py identify SO

2013-06-19 Thread Gustavo Carneiro
On Wed, Jun 19, 2013 at 3:15 PM, Hélio Miranda wrote: > I was trying this: > *if os.name == 'nt':* > *sys.path.append('c:/Projectos/Test/') # Windows* > *else:* > *sys.path.append('/srv/django/OnPitch/') # other (unix)* > > doing so, looking at the link that you send

Re: File wsgi.py identify SO

2013-06-19 Thread Hélio Miranda
ok, thanks for the help -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to

Re: Passing parameters via POST in django 1.5

2013-06-19 Thread o_r
They are not in the url, but in the body. I saw this now: Changed in Django 1.5: Before Django 1.5, HttpRequest.POST contained non-form data. This means I have to put this in the header: ContentType: application/x-www-form-urlencoded Seems that jquery does this for you when you serialize a

Re: readonly_fields

2013-06-19 Thread Timster
It's all in the documentation: https://docs.djangoproject.com/en/1.5/ref/forms/widgets/ On Wednesday, June 19, 2013 9:37:41 AM UTC-4, tony gair wrote: > > Ah thanks that explains that I'll look into changing the readonly > attribute on the widget, is there a list of widgets do you know as

reverse funtion gives me url including server path

2013-06-19 Thread Jiří Kupka
Hi! I have little trouble with reverse function in my project. When I run it over ./manage runserver, everything is fine - reverse gives me url in /page/xx format. When I run my project over apache2 using this conf file: Listen 8001 ServerName project.tld DocumentRoot

reverse function gives me url including server path

2013-06-19 Thread Jiří Kupka
Hi! I have little trouble with reverse function in Django. When I run my project as ./manage runserver, everything is just fine - reverse gives me url in /page/xxx format. When I run it as apache2 instance using this conf file: Listen 8001 ServerName project.tld DocumentRoot

Re: Having an issue with Minimal File Upload utility

2013-06-19 Thread Matt Lind
My Settings.py: # Django settings for EqlAnalystToolSet project. import os, ldap from django_auth_ldap.config import LDAPSearch, ActiveDirectoryGroupType DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_em...@example.com'), ) MANAGERS = ADMINS DATABASES = {

Re: export .csv file from database

2013-06-19 Thread Vernon D. Cole
I am guessing that your csv writer is outputting something that your spreadsheet is reading incorrectly. Try opening the csv with a text editer (a good one, like Notepad++) so that you can really see what is going on. Embedded commas or quotes inside a field are invitations for disaster, and

Re: export .csv file from database

2013-06-19 Thread Radomir Wojcik
> > this might come of use, it exports any query set to csv. I use it a lot: > > def queryset_export_csv(qs): import csv #from django.db.models.loading import get_model response = HttpResponse(mimetype='text/csv') # force download. response['Content-Disposition'] =

captcha field django form designer, success html mail.

2013-06-19 Thread pradnya
Hi !, I am working on django cms based website. Where I used django form designer( https://github.com/samluescher/django-form-designer) Now I want to integrate djago-recaptcha with django form designer to add captch field in form. In django-form-designer settings.py FIELD_CLASSES =

Re: captcha field django form designer, success html mail.

2013-06-19 Thread Felipe Coelho
2013/6/19 pradnya > ... > > ('django.forms.RegexField', _('Regex')), > > ('django.forms.FileField', _('File')), > > # ('captcha.fields.CaptchaField', _('Captcha')), > > The django-recaptcha field is called "ReCaptchaField", not just "CaptchaField" -- You

Sending emails, models or views?

2013-06-19 Thread Marc Aymerich
Yep, I'm more or less convinced that the logic needed for sending an email should go into models. But what about the action (method call) of sending the email? what layer should be responsible for triggering an email notification? models or views? This is something I keep wondering myself for a

DjangoCon. US CFP extended

2013-06-19 Thread Christophe Pettus
Hi, all, We're extending the CFP for DjangoCon US 2013 through 6/25, since there was a last-minute burst of activity. We are still looking for talks and tutorials; first-time presenters particularly encouraged to participate! The URL is: http://www.djangocon.us/cfp/ (The site is

Re: reverse funtion gives me url including server path

2013-06-19 Thread Timster
It's this line: PythonOption django.root /var/www/project Change that to / or anything else and you should be all set. On Wednesday, June 19, 2013 10:32:12 AM UTC-4, Jiří Kupka wrote: > > Hi! I have little trouble with reverse function in my project. When I run > it over ./manage runserver,

Cannot import mypackage with code in the __init__.py file

2013-06-19 Thread fred
I'm upgrading to django 1.5.1 on CentOs 6.4 with python 2.6.6 although I'm developing on a W7 with the django debug server. I am getting executing my view.py and most of the modules it uses. But in one scenario, the import fails, see directory outline below NewMdsServer |___NewMdsServer

Re: Cannot import mypackage with code in the __init__.py file

2013-06-19 Thread Bill Freeman
Have you tried import app.mypackage or from app import mypackage Or, from within views.py or mymodule.py, if you have done from __future__ import absolute_imports then try import .mypackage (There is a period before "mypackage" on that line.) On Wed, Jun 19, 2013 at 2:51 PM,

Re: Cannot import mypackage with code in the __init__.py file

2013-06-19 Thread fred
a quick update, if I use >python manage.py shell everything works as I would expect, no problems. also I tried removing all code from my __init__.py (yes I'm grasping at straws) and that did not help. -- You received this message because you are subscribed to the Google Groups "Django

Script to move django 1.4.3 to 1.5.1

2013-06-19 Thread Deepak Sharma
Hi everyone I just started learning django. Question arises in my mind to write a script, by using that script i wanted to jump django version 1.5.1 without effecting my previous settings or effecting my application which is currently running on django 1.4.3. Is it possible to do that? If yes

How to use lxml with django

2013-06-19 Thread cha
how generate xml or dme file django I want the result be like this : asfa Adnan Company asfa Adnan Company Model for asfa Adnan Alaaadnan Company -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: user authentication with extended (AbstractUser) user model

2013-06-19 Thread Evan Stone
Sure thing. Here are the snippets that gave me pause: "Think carefully before handling information not directly related to authentication in your custom User Model. It may be better to store app-specific user information in a model that has a relation with the User model. That allows each app

Re: user authentication with extended (AbstractUser) user model

2013-06-19 Thread Evan Stone
Also, thank you again! On Wednesday, June 19, 2013 3:16:05 PM UTC-5, Evan Stone wrote: > > Sure thing. Here are the snippets that gave me pause: > > "Think carefully before handling information not directly related to > authentication in your custom User Model. > > It may be better to store

RE: Sending emails, models or views?

2013-06-19 Thread Babatunde Akinyanmi
Coincidentally, I debated this with myself this afternoon. At the end, i put my notify_by_email method in models.py because I didn't need the request object and it kinda "felt at home" there. However, I'd have put it in my view if I needed the request object so personally, it depends on use case.

Re: How to use lxml with django

2013-06-19 Thread Ovnicraft
Hello, On Wed, Jun 19, 2013 at 3:09 PM, cha wrote: > how generate xml or dme file django > I want the result be like this : > > asfa Adnan > Company > asfa Adnan > Company Model for asfa > Adnan > Alaaadnan > > Company > > Your question

Re: How to use lxml with django

2013-06-19 Thread cha
Please Can Give Me Simple Example For View in Django On Wednesday, 19 June 2013 16:24:07 UTC-4, ovnicraft wrote: > > Hello, > > On Wed, Jun 19, 2013 at 3:09 PM, cha wrote: > >> how generate xml or dme file django >> I want the result be like this : >> >> asfa

Multiple modelforms, mixing existing and non existing instances

2013-06-19 Thread Freddy
Hi everyone, I'm trying to get a particular formset, but i'm stuck on it. In my database, I have some information stored around external data, represented by this kind of model : LiveInfo(models.Model): external_id = models.IntegerField() live_url = models.URLField() description =

Calling ffmpeg doesn't work on apache server

2013-06-19 Thread Chad Vernon
I'm trying to use ffmpeg to generate a thumbnail for a video. It works just fine when I call it from a python shell and when I test it in "python manage.py shell". However when I try to run from the apache server running locally, I get an error: # normally I call subprocess.call, but for debug

Re: Calling ffmpeg doesn't work on apache server

2013-06-19 Thread Chad Vernon
Looks like it has something to do with calling subprocess from the server because this gives the same error: response = subprocess.check_output(['which', 'ls']) Anyone have any suggestions? On Wednesday, June 19, 2013 4:01:30 PM UTC-7, Chad Vernon wrote: > > I'm trying to use ffmpeg to

Per-Request Query-set Cache

2013-06-19 Thread Kurtis
I could have sworn I've already asked this question but didn't see it in my search results. Anyways, I have a large set of calculations in my models. I'm trying to stick with the OOP style for future maintainers or whomever else has to work with the code. The problem is that I'm up to 100

Re: Per-Request Query-set Cache

2013-06-19 Thread Joey Espinosa
Look into johnny-cache. https://github.com/jmoiron/johnny-cache -- Joey "JoeLinux" Espinosa Python Developer http://about.me/joelinux On Jun 19, 2013 7:33 PM, "Kurtis" wrote: > I could have sworn I've already asked this question but didn't see it in > my search

Re: Calling ffmpeg doesn't work on apache server

2013-06-19 Thread Chad Vernon
One last observation: I think it has something to do with the apache user permissions. I'm running the mod_wsgi daemon process with myself as the user and I need to specify the full path to ffmpeg (/usr/local/bin/ffmpeg). Even when I do that the function runs every other time. So I'm

Re: Script to move django 1.4.3 to 1.5.1

2013-06-19 Thread Russell Keith-Magee
On Thu, Jun 20, 2013 at 3:17 AM, Deepak Sharma wrote: > Hi everyone > > I just started learning django. Question arises in my mind to write a > script, by using that script i wanted to jump django version 1.5.1 without > effecting my previous settings or effecting my

Re: Calling ffmpeg doesn't work on apache server

2013-06-19 Thread John
Chad, Are you restarting apache after each change? It sounds like you have the default 2 workers and you are getting two different 'versions' alternately. Apache needs to be restarted if you change something (or there's some magic touch you can do with wsgi that I forget). Otherwise it does look

Re: user authentication with extended (AbstractUser) user model

2013-06-19 Thread Russell Keith-Magee
On Thu, Jun 20, 2013 at 4:16 AM, Evan Stone wrote: > Sure thing. Here are the snippets that gave me pause: > > "Think carefully before handling information not directly related to > authentication in your custom User Model. > > It may be better to store app-specific user

Installing/implementing a Python-based API on my website

2013-06-19 Thread C. N. Desrosiers
Hi, I recently completed the Capitol Words API course at codecademy.com and I have experience building websites in HTML + CSS, but I have never installed an API before. I can manipulate the Python code on its own, but I don't understand the steps between having the Python code in order and

Re: Script to move django 1.4.3 to 1.5.1

2013-06-19 Thread Deepak
Okay but my situation is bit different. I am updating my university software. That software is wrote in django version 1.3.1. My challenge was to run that software on 1.5.1 and i completed that. As many things changed in django 1.5.1 like < direct_to_template > changed to < TemplateView> and

Re: How to use lxml with django

2013-06-19 Thread cha
waiting for you On Wednesday, 19 June 2013 16:24:07 UTC-4, ovnicraft wrote: > > Hello, > > On Wed, Jun 19, 2013 at 3:09 PM, cha wrote: > >> how generate xml or dme file django >> I want the result be like this : >> >> asfa Adnan >> Company >> asfa >> Adnan

RE: Cannot import mypackage with code in the __init__.py file

2013-06-19 Thread Sells, Fred
Thanks Bill, I've tried all but the __future__ option. I'll give it a try. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Bill Freeman Sent: Wednesday, June 19, 2013 3:03 PM To: django-users Subject: Re: Cannot import mypackage with code in the