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.
S
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 problem with that is that
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,
>>
>> I am building a
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 using form_valid method i
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 =
Achiev
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
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
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 f
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.
https://docs.djan
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 **= form.cleaned_data["your_e
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,
E
>
> 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 thi
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 litt
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, your_
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
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 excepti
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.
Th
17 matches
Mail list logo