Help w/Transactions, select_for_update!

2016-03-22 Thread A Wall
Really hoping someone can help---didn't get any responses on stackoverflow, and django docs don't seem to give an exact answer. I have a bunch of views where I check if certain conditions are true before executing. I'm concerned about one user using a view that changes the data after the

HStoreField - Field value is an object usually, but a string when in shell

2016-03-22 Thread Andrew Grossman
I'm working with a model that has an HStoreField field named "options". The options field on a model instance is a dictionary when running the webserver, but is a string when in the shell. This isn't simply a matter of it being coerced by the shell; the model's attribute dictionary and *dir()*

Extending Form to include 'placeholder' text

2016-03-22 Thread Rich Rauenzahn
Hi, I'd like to make a mixin to set the placeholder text in the widget attrs. Reading this https://code.djangoproject.com/ticket/5793, it seems that extending Meta for custom fields is somewhat discouraged. Would the following be the recommended way to do it? Just adding a class variable to

Re: get email address of the user in views

2016-03-22 Thread jorrit787
You should be able to use *request.user.email*, assuming you have the *django.contrib.auth* app installed and the user is logged in. On Tuesday, March 22, 2016 at 1:33:39 PM UTC+1, Vasu Dev Garg wrote: > > I want to get the email address of the user which i filter in views > function. How to

Re: Architecture of multiple Sites

2016-03-22 Thread jorrit787
But if I don't set the SITE_ID in settings.py I can't use the CurrentSiteManager, correct? On Tuesday, March 22, 2016 at 1:33:39 PM UTC+1, Sai Kiran wrote: > > If you need to use single projects for more than domains, create an entry > in django_site model by giving domain as well as verbose

Re: Django Forms vs Angularjs

2016-03-22 Thread Fabio C. Barrionuevo da Luz
self.fields[name].widget.attrs['disabled'] = 'disabled' self.fields[name].widget.attrs['readonly']=True is not make real readonly to field, because if user can edit the html on client side, and remove disabled="disabled" and readonly input atributtes to problem of readonly fields, i currently

Re: Django Forms vs Angularjs

2016-03-22 Thread Gorkem Tolan
Actually I do to set permission to each field. A field in the form can be viewable and editable, only viewable, or hidden. So if user has a permission to see the form, but edit some fields in the form, it gets very tricky especially for validation. For example I used these statements to make

Re: Django Forms vs Angularjs

2016-03-22 Thread bobhaugen
Maybe you already know this, but you can do a lot of form tinkering in __init__, like so: def __init__(self, permissions_parameter=None, *args, **kwargs): super(FormName, self).__init__(*args, **kwargs) if permissions_parameter: #do a bunch of form tinkering --

Re: Django Forms vs Angularjs

2016-03-22 Thread Gorkem Tolan
Thanks for your response. Currently I am dealing with a form with individual field permissions. I guess it explains it gets difficult with Django Form, which are made for only editing. I know a custom read-only field can be created in the code below. I am still struggling with post the form

Re: DJANGO TUTORIAL

2016-03-22 Thread Bob Gailer
On Mar 21, 2016 7:24 PM, "Anthony W Smith" wrote: > > When I follow django tutorial on the django site for the polls app I keep getting the error after runnig the python manage.py runserver command it says no modsule named my site. You could 1) show us your directory

Re: Architecture of multiple Sites

2016-03-22 Thread Sai Kiran
If you need to use single projects for more than domains, create an entry in django_site model by giving domain as well as verbose name. Don't give any SITE_ID in settings.py, instead of this you can use Site.objects.get_current() in your view and compare the domain names and change the header

get email address of the user in views

2016-03-22 Thread Vasu Dev Garg
I want to get the email address of the user which i filter in views function. How to get it? -- 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

Re: DJANGO TUTORIAL

2016-03-22 Thread Elorm Koku
where are you running the ./manage.py runserver it should be in the same root Agbeko Frank +233 0243 013 730 On Tue, Mar 22, 2016 at 11:10 AM, Rafael E. Ferrero < rafael.ferr...@gmail.com> wrote: > do you already have your site on setttings.py ? > > > Rafael E. Ferrero > > 2016-03-21 20:24

Re: DJANGO TUTORIAL

2016-03-22 Thread Rafael E. Ferrero
do you already have your site on setttings.py ? Rafael E. Ferrero 2016-03-21 20:24 GMT-03:00 Anthony W Smith : > When I follow django tutorial on the django site for the polls app I keep > getting the error after runnig the python manage.py runserver command it > says no

Re: Pass these specific model objects to one template

2016-03-22 Thread ludovic coues
Have your tried to replace the view return with something similar to this line ? return render( request, '/signup.html/', {'data': sorted( currPersonData.items( ) ), 'eb': Elective.objects.all() }, ) 2016-03-22 7:57 GMT+01:00 Pemby : > > > > All of the above seems

More declarative way to tie permissins to CBV

2016-03-22 Thread guettli
My goal: If user "foo" comes to the me (playing the admin role) and says: I don't have permissions for URL "foo-url", then I want to enter the URL and the username into some admin interface and then the this should tell me why the user is allowed or not allowed to access the URL. Example

Re: Pass these specific model objects to one template

2016-03-22 Thread Pemby
All of the above seems to be working the way I expect it to. I can get the data I am after and pass it to a template. Now I would like take all objects, of the below model, and pass all these objects it to my '/signup.html/'* IN ADDTION* to what is being passed above so I can start* form

Pass these specific model objects to one template

2016-03-22 Thread Pemby
Person Model class Person( models.Model ): first_name = models.CharField( max_length=50 ) last_name = models.CharField( max_length=50 ) def __str__(self): return "{0} {1}".format( self.first_name, self.last_name ) View Function def getPersonData(request):