Re: Upgrading Django (to 1.7)

2014-10-09 Thread Fred Stluka
Andrew, Yes, that explains a lot. I'd recommend including this explanation in one of the articles of your current series. BTW, one other thing to keep in mind is that we 1.4 users don't know what an apps.py file is, so we don't appreciate not having to create one, since we never did before.

Custom Exception Handler not being called

2014-10-09 Thread Néstor Boscán
Hi I've created a rest service using the APIView and created my own custom exception handler. I configured my custom exception handler in my settings.py file using: REST_FRAMEWORK = { 'EXCEPTION_HANDLER': 'module.custom_exception_handler' } But when an exception is raised my custom

Re: Upgrading Django (to 1.7)

2014-10-09 Thread Andrew Pinkham
Hi Fred, Thanks again for the positive feedback! I'm sorry I lost you at the App Registry section. I'm afraid I can't recommend an article to help with the topic, either. Given your questions, I can see I missed the mark. Let me give it another go (warning: this is neither technically reviewed

best aproach to pass an email from the url to a view?

2014-10-09 Thread dk
I put the Email that I got from a form into the url (I am using the url as a variable to store the email) and look like this http://127.0.0.1:8000/polls/vote/thank/a...@b.com/ url: url(r'^vote/thank/(? #here should be RE catching the email )$', views.thank), view: def thank(request,

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

2014-10-09 Thread Russell Keith-Magee
Hi Eliezer, The trick is to add a ModelAdmin for Exercise. The obvious consequence of this is that you'll get a "top level" menu option to add exercises. However, a side effect is that everywhere that you have a model with a foreign key to exercise (like in your Segment inline), you'll get a

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

2014-10-09 Thread Collin Anderson
> > ok now to learn how to catch that url > will something like this would work? > url(r'^thanks/(?Pw+)/$', views.thanks), > That should work in theory, although the "w" in the regular expression won't match the @ sign or the periods. If you use the /thanks/?email=y...@email.etc you can use

Re: Upgrading Django (to 1.7)

2014-10-09 Thread Fred Stluka
On 10/8/14 11:30 PM, Andrew Pinkham wrote: Hi, Upgrading Django (to 1.7) Part III: Django 1.7's New Features is now available! For the article: afrg.co/updj17/a3/ For all of the material: afrg.co/updj17/ Any feedback appreciated. I hope you find the material helpful. Andrew Andrew,

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

2014-10-09 Thread dk
Ah nice trick, store the variables into the url and then pass the url with some regular expression. =) def vote(request): if request.method == "POST": form = polls.forms_DK.NameForm(request.POST) if form.is_valid(): *your_email **=

Re: permissions and inlines issues

2014-10-09 Thread Collin Anderson
Why can't the first two users edit the data the same way as user 3? I'd recommend overriding get_readonly_fields() on the ModelAdmin for A so that all fields are readonly for the users who aren't allowed to edit model A. They'll still need the "can edit" permission for model A.

Re: Multiple django inlineformset_factory problem

2014-10-09 Thread Collin Anderson
Ahh, yes, those docs assume you've also read the non-model formset docs: https://docs.djangoproject.com/en/1.7/topics/forms/formsets/ Why do I get 3 "Implementation" forms, instead of just 1, when I did > Controls.objects.get(pk=1), which should specify a single Control? It will show one form

permissions and inlines issues

2014-10-09 Thread Emanuel
Hi all! I have this situation: class A(models.Model): ... class B(models.Model): --- class C(models.Model): Then I have User 1, User 2 and User 3 B and C are inlines for A I register A, B and C in admin I want User 1 and add and edit B and can't add or edit A and I want User

Multiple django inlineformset_factory problem

2014-10-09 Thread Farhan Khan
Hi all, I am writing a tool that implements NIST security controls and having trouble implementing inlineformset_factory, which I think is the solution to this problem. Background: I have two models, one is called 'Controls' and the other is 'Implementation'. When the user goes to a page, the

Re: positiveintegerfield - display value in add template & remove value in edit template

2014-10-09 Thread Collin Anderson
hmm... you may need to override the form field on your form. I'm going to go out on a limb and use some soon-to-be documented syntax. new_choices = [(id, v) for id, v in AchievementDetails.ACHIEVEMENT_TYPES if id != 0] class AchievementDetailsForm(forms.ModelForm): achievement_type =

Re: Weird form validation question

2014-10-09 Thread Sergiy Khohlov
could you please paste code in form valid block ? Many thanks, Serge +380 636150445 skype: skhohlov On Thu, Oct 9, 2014 at 11:23 AM, termopro wrote: > I am using form.is_valid() > > On Thursday, October 9, 2014 10:54:56 AM UTC+3, Sergiy Khohlov wrote: >> >> Are you

Re: Weird form validation question

2014-10-09 Thread termopro
I am using form.is_valid() On Thursday, October 9, 2014 10:54:56 AM UTC+3, Sergiy Khohlov wrote: > > Are you using form_valid method in view ? > > Many thanks, > > Serge > > > +380 636150445 > skype: skhohlov > > On Thu, Oct 9, 2014 at 10:10 AM, termopro > wrote: > >> Hi,

Re: Weird form validation question

2014-10-09 Thread Sergiy Khohlov
Are you using form_valid method in view ? Many thanks, Serge +380 636150445 skype: skhohlov On Thu, Oct 9, 2014 at 10:10 AM, termopro wrote: > Hi, > > I am building a user registration page. Page has a form where user can > select his current state and city. > > The

Weird form validation question

2014-10-09 Thread termopro
Hi, I am building a user registration page. Page has a form where user can select his current state and city. The problem with that is that i cannot load list of cities into the form when the page is being generated. That's because i show the user only cities from his state, not all of them.

Re: issues with get_initial() in CreateView?

2014-10-09 Thread Sergiy Khohlov
Could you please paste your form_valid method ? You should update it for right saving object Many thanks, Serge +380 636150445 skype: skhohlov On Thu, Oct 9, 2014 at 7:40 AM, Lachlan Musicman wrote: > Ok, I think it's because the modela is not passed in the POST data.