Jump to content


Check out our Community Blogs

BenasG

Member Since 24 Apr 2012
Offline Last Active Jun 07 2012 03:08 AM
-----

Topics I've Started

Django User Object And Field Update

29 May 2012 - 08:19 AM

Hello everybody!

I have one problem. I`m creating registration with activation app. Everything was alright until I though to make ability to resend activation key.
Okey this is my code:
def loginRequest(request):
	    if request.method == 'POST':
		    form = LoginForm(request.POST)
		    if form.is_valid():
			    username = form.cleaned_data['username']
			    password = form.cleaned_data['password']
			    user = authenticate(username=username,password=password)
			    if user is not None:
				    if user.is_active:
					    login(request,user)
					    return HttpResponseRedirect('/profile/')
				    else:
					    return HttpResponseRedirect('/activate_error/')
			    else:
				    return render_to_response('base.html',{'form':form},context_instance=RequestContext(request))
		    else:
			    return render_to_response('base.html',{'form':form},context_instance=RequestContext(request))
	    else:
		    form = LoginForm(request.POST)
		    return render_to_response('base.html',{'form':form},context_instance=RequestContext(request))
when person login and are not activated account, he redirected to activate_error site. And then can take request to resend activation key. Okey, question is: how to know which person was redirected to this error site?

And one more, how to update model field?

Django Get Data From Xml Internet Site

15 May 2012 - 04:20 AM

Hello, evrybody!

I have one question, how to get data from xml file, witch is on internert site?

Thanks, brother!

Random Integer Except Some Numbers

06 May 2012 - 11:47 AM

Hello, I want to generate number from 1 to 21, but also want that random function skip some numbers like 5, 7, 13, 16.
I using this code:
private int RandomNumber(int min, int max)
	    {
		    Random random = new Random();
		    return random.Next(min, max);
	    }

and this for get number
do
		    {
			    nubmer = RandomNumber(1, 21);
		    } while ((number == 5) || (number == 7) || (number == 13) || (number == 16))
Okey, problem is, that this generation method call stackoverflown error.

On Class B Access Labels/buttons From Class Form1

06 May 2012 - 06:12 AM

Hello everybody!

have one question, how to access labels/buttons etc on other class?
Thanks, brothers & sisters!

Check Which Button Was Clicked.

29 April 2012 - 02:07 PM

Hello, again!

one more question, how to check which button was clicked?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download