Re: cant pass the "CSRF verification failed. Request aborted." error

2014-10-07 Thread dk
I am using 1.7 -- 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

django admin interface - how to enable adding new entries to foreign key-linked dropdown menu?

2014-10-07 Thread Eliezer Kanal
I'm writing a rudimentary exercise app in django, with the following table structure: Routine Exercise Segment = = = routine_name exercise_name routine_id (fk) routine_id exercise_id exercise_id (fk) order duration * (fk) = foreign key In practice, this looks as follows:

Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-07 Thread Collin Anderson
My bad. Put your add_view in views.py (cause it's a view :) Then, you'll need to import your form into your view: from oneidentry.forms import HardwareidForm -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-07 Thread Bovine Devine
On Tuesday, October 7, 2014 4:49:04 PM UTC-7, Collin Anderson wrote: > > > Am I correct in understanding that using ModelForm example you listed as > a view does not need to be added to urls then? What is the user access page > then? > The add_view would need to be added to your urls. > > I

Re: question about userprofile

2014-10-07 Thread Collin Anderson
> > But after that I don't understand how I can use the information in the > user table (like the pages that the user is allowed to enter) in django > and how to set it somewhere. And also since I should change the menu to > reflect that the user can go or not to one page how can I send this

Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-07 Thread Collin Anderson
> Am I correct in understanding that using ModelForm example you listed as a view does not need to be added to urls then? What is the user access page then? The add_view would need to be added to your urls. > So is this two different ways to do the same thing? The main difference is that it's a

Re: Is Django an easier solution in order to be able to track click info and establish foreign keys, or can I just use python to complete this task?

2014-10-07 Thread Collin Anderson
I would personally just use plain python for this. It's totally possible to group things together using dicts and setdefault(). (Or, since it doesn't look like speed is an issue, just loop over the whole file every time you need to get info.) It may be though that you think a lot more in terms

question about userprofile

2014-10-07 Thread Lorenzo Bernardi
Hello, I'd like to emphasize that it is probably a newbie question but I don't know what are the keyword I should use for googling. So any information would be helpful. I'm trying to add a userprofile to my django app. The idea is to use a sign-in system so that the user depending on

Is Django an easier solution in order to be able to track click info and establish foreign keys, or can I just use python to complete this task?

2014-10-07 Thread Wadson Espindola
The aim of this exercise is to combine the sample database, click tracking information from a test website and application, and information from user's social networks. The sample database contains the following fields and is made up of 500 records. first_name, last_name,

Advice on template, list of objects from several models

2014-10-07 Thread Anders
Hello, I am looking for some feedback on a seemingly simple problem. My advertisement board project have 10+ models, one model per item category (Cars, Pets, Apartments and so on). The common fields (title, seller, location etc.) is defined in "MyAbstractModel" and inherited by all other category

Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-07 Thread Bovine Devine
Thanks for the help Collin...I need to read through more of the documentation it seems! Going through the chapter am I correct in understanding that using ModelForm example you listed as a view does not need to be added to urls then? What is the user access page then? Sorry this is all really

Re: View didn't return an HttpResponse object

2014-10-07 Thread Dariusz Mysior
It work's! :) Thank You!! now I have: def password_change_dom(request): if request.method == 'POST': form = FormularzPasswordChange(request.POST) if form.is_valid(): request.user.set_password(form.cleaned_data['password2'])

Re: View didn't return an HttpResponse object

2014-10-07 Thread Collin Anderson
are they already logged in? use request.user.set_password() and request.user.save() -- 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: View didn't return an HttpResponse object

2014-10-07 Thread Dariusz Mysior
It was like You said, now I see form and when I write password and submit I have KeyError at /password_change/ 'username' Request

Re: View didn't return an HttpResponse object

2014-10-07 Thread Collin Anderson
also, I highly recommend the render() shortcut: def password_change_dom(request): if request.method == 'POST': form = FormularzPasswordChange(request.POST) if form.is_valid(): user = authenticate(username=form.cleaned_data['username'])

Re: View didn't return an HttpResponse object

2014-10-07 Thread Collin Anderson
unindent the last bit: > if request.method == 'POST': > form = FormularzPasswordChange(request.POST) > if form.is_valid(): > user = authenticate(username=form.cleaned_data['username' > ]) > #user =

Re: prepopulated_fields is not changed only after user typed text there

2014-10-07 Thread Collin Anderson
It looks like it's supposed to only change the slug if the slug was blank when the page loaded. https://code.djangoproject.com/ticket/19082 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: View didn't return an HttpResponse object

2014-10-07 Thread Dariusz Mysior
It's : ef password_change_dom(request): if request.method == 'POST': form = FormularzPasswordChange(request.POST) if form.is_valid(): user = authenticate(username=form.cleaned_data['username']) #user =

Re: View didn't return an HttpResponse object

2014-10-07 Thread Collin Anderson
What does your password_change_dom view look like? -- 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

How to implement chained/related dropdown lists in a page

2014-10-07 Thread Frankline
I am interested in knowing how other developers implement chained dropdown lists that are dependent on one another. As an example, I have a page/form that has two dropdown lists. When I select a value from the first select, I want the second dropdown to be populated by records related to the first

prepopulated_fields is not changed only after user typed text there

2014-10-07 Thread Vitaly
Hi all Does anybody know the reason why in django1.7 prepopulated fields is not changed only after user typed text there? Is that bug or what? For example class Post(models.Model): title = models.CharField('Title', max_length=128) url = models.SlugField('Url') class

View didn't return an HttpResponse object

2014-10-07 Thread Dariusz Mysior
I have form to change password like below, and when I try to display it I have an bug: ValueError at /password_change/ The view dom.views.password_change_dom didn't return an HttpResponse object.

Re: AppConfig where to execute initialization queries?

2014-10-07 Thread Collin Anderson
Could you somehow lazy initialize? Somehow auto-initialize things the first time they are called for? The other, kind of hacky place to do it is at the top of your urls.py, which should run on the first request. -- You received this message because you are subscribed to the Google Groups

Re: How to trace a page not showing up?

2014-10-07 Thread Collin Anderson
Or raise an exception or use print statements. It could also be that nginx is timing out, but usually it will say that. You could open up the development tools (right click, inspect element) and see what error code the network tab says. -- You received this message because you are subscribed

Re: django UserAdmin

2014-10-07 Thread Collin Anderson
Would something like this work? class UserAdmin(admin.ModelAdmin): list_display = ('email', 'first_name', 'last_name','is_staff', 'phone_no') def phone_no(self, user): return user.smsregistration.phone_no -- You received this message because you are subscribed to the Google

Re: Lazy relation not resolved when get_defaults get called

2014-10-07 Thread Collin Anderson
I use this to fix that problem. Run it before you use your first model. from django import models models.get_models() -- 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

Re: How do I create a simple user view web page to create/add mysql db entries?

2014-10-07 Thread Collin Anderson
Using a plan ModelForm in a few to create objects is surprisingly not well documented :) https://docs.djangoproject.com/en/1.7/topics/forms/modelforms/ Basically you do something like this: from django import forms class MyForm(forms.ModelForm): class Meta: model = MyModel

Re: поиск

2014-10-07 Thread Sergiy Khohlov
Check this one. http://stackoverflow.com/questions/23304821/django-ajax-populate-form-with-model-data also could you please use English in this list ? Many thanks, Serge +380 636150445 skype: skhohlov 2014-10-07 17:58 GMT+03:00 RSS : > направьте, пожалуйста > есть

поиск

2014-10-07 Thread RSS
направьте, пожалуйста есть форма: 1. первый выпадающий список, одна запись которой равна одной модели 2. в зависимости от выбранной модели, остальные поля принадлежат одной модели если можно ссылки или примеры -- You received this message because you are subscribed to the Google Groups

Best way to change Site.__str__ to return name not domain

2014-10-07 Thread Michael Jones
Hi, I am using the sites framework and finding it very useful but I would prefer the Site.__str__ method to return the site name instead of the domain. What is the best way of going about that? Is it reasonable to monkey patch it or do I need to make my own sites app with a copy of the code?

Re: Full text search available on PostgreSQL?

2014-10-07 Thread Benjamin Scherrey
Did you find a solution that worked with ModelAdmin.search_fields & Postgres? I'm running into the same question. thanx, -- Ben On Sat, Jun 28, 2014 at 11:15 PM, Bastian Kuberek wrote: > Hi, > > Just saw that django.contrib.admin.ModelAdmin.search_fields >

django-admin2 into production environment

2014-10-07 Thread Fabio C. Barrionuevo da Luz
hello, I wonder if anyone successfully uses the django-admin2[1] in the production environment If so, what are your thoughts on the pros and cons based on your experience of use. You have a site or blog which records the problems and solutions encountered when using and customize django-admin2

Re: How to trace a page not showing up?

2014-10-07 Thread Erik Cederstrand
Den 07/10/2014 kl. 12.57 skrev Helgi Örn Helgason : > Hi! > I am quite new when it comes to Django and Python. I am responsible for a > rather disfunctional Django website package which is rather messy (I have > this confirmed by an experienced Django/Pyton developer who

How to trace a page not showing up?

2014-10-07 Thread Helgi Örn Helgason
Hi! I am quite new when it comes to Django and Python. I am responsible for a rather disfunctional Django website package which is rather messy (I have this confirmed by an experienced Django/Pyton developer who took a look at it). The system is in use serving a school organisation. My most

Lazy relation not resolved when get_defaults get called

2014-10-07 Thread Ghislain Leveque
I'm in a situation where the get_defaults method on the RelatedField class is called but self.rel.to as not been resolved yet and is still a string. I'm using Django 1.6.6 and I cannot upgrade easily (big number of systems in production). Some important stuff : - the problem appears when I

How do I create a simple user view web page to create/add mysql db entries?

2014-10-07 Thread Bovine Devine
I have gone through the django tutorial but seem to be lost on how to create a simple user view page that allows me to add/post/create data directly to the connected mysql database. I have the models view working and can access and add items in admin view but not sure how/what is the best way

How to trace a vanished page?

2014-10-07 Thread Helgi Örn Helgason
Hi! I am quite new when it comes to Django and Python. I am now responsible for a rather disfunctional Django website package which is quite messy, to say the least (I have this confirmed by an experienced Django/Pyton developer). The system is in use serving a school organisation. My most

Re: Show a model on the admin list index page

2014-10-07 Thread Andrea
I think I've found the problem. In my Django version I have in `contrib/admin/sites.py` line 371: has_module_perms = user.has_module_perms(app_label) Here it is instead: https://github.com/django/django/blob/master/django/contrib/admin/sites.py line 383: has_module_perms =

Re: Show a model on the admin list index page

2014-10-07 Thread Daniel Rus Morales
I think it’s clear to me what you are trying to do. By overriding those methods in BarAdmin you go down that line (bypass the django admin permission system), but to get the app listed in the admin index page you would have to actually rewrite the view function. This view function makes an

Re: Show a model on the admin list index page

2014-10-07 Thread Andrea
Dear Daniel, I want to answer to an issue you raised in your previous message. The Bar model doesn’t appear in the App index list page because the view > function in charge first verifies whether the user has any of the > add/change/delete permissions granted for such App, and given that your >

Re: Show a model on the admin list index page

2014-10-07 Thread Andrea
Dear Daniel, thank you for your answer. I think I was not clear enough in explaining my problem. I will try to rephrase the problem, please tell me if from the first message this point was clear or seemed different. I do want that the user is able to add or change some objects. My goal is to

Re: Show a model on the admin list index page

2014-10-07 Thread Daniel Rus Morales
Hi Andrea, I answer below in between lines. On 07 Oct 2014, at 08:53, Andrea wrote: > Let's suppose I have a Foo app with a Bar model with a owner field. I want a > user to be able to edit all the instances for which obj.owner == request.user. > > The model appears

django UserAdmin

2014-10-07 Thread Sachin Tiwari
Hi, I added an extra field phone number in existiing user model and now I tyring to access that field by below method, UserAdmin.list_display = ('email', 'first_name', 'last_name','is_staff', SMSRegistration.phone_no) type object 'SMSRegistration' has no attribute 'phone_no' Please help.

Show a model on the admin list index page

2014-10-07 Thread Andrea
Let's suppose I have a Foo app with a Bar model with a owner field. I want a user to be able to edit all the instances for which obj.owner == request.user. The model appears correctly in the admin panel for superusers and for users for which I have explicitly assigned the permission change_bar or