Re: Working with forms

2021-06-15 Thread Williams Andy Inc
for now reason its now showing up thanks. i guess i needed to do hard refresh with f5 although i was using {% now "U" %} On Tue, Jun 15, 2021 at 10:10 AM Williams Andy Inc wrote: > class LoginForm(forms.Form): > username = forms.CharField( > label="Email or Username", > wid

Re: Working with forms

2021-06-15 Thread Williams Andy Inc
class LoginForm(forms.Form): username = forms.CharField( label="Email or Username", widget=forms.TextInput( attrs={ "class": "fas fa-user", "placeholder": "f007 Username or Email", } ), ) the class is not showin

Re: Working with forms

2021-06-15 Thread Williams Andy Inc
Thanks am already trying that, and using that works for adding placeholder, but then it doesn't add a class, if it could add i class i could use the font awesome unicode which would have been the easiest solution. On Tue, Jun 15, 2021 at 9:53 AM Lalit Suthar wrote: > you can try if it can be

Re: Working with forms

2021-06-14 Thread Lalit Suthar
you can try if it can be done with widgets I am not sure https://docs.djangoproject.com/en/2.2/ref/forms/widgets/ On Tue, 15 Jun 2021 at 11:24, Williams Andy Inc wrote: > I would like to know is there any easier way rather than overriding super, > how do i add icons into the html input eg to hav

Working with forms

2021-06-14 Thread Williams Andy Inc
I would like to know is there any easier way rather than overriding super, how do i add icons into the html input eg to have a key icon on the password field without installing any third party app also. is the best solution to render form in html and pass field values to django? or is there a

Re: Working with forms

2020-04-06 Thread waqar khan
hey I am waqar, i have created user form but not working please solve my problems admin: username:-admin password:-admin user: username:-waqar password:-Test@123 On Mon, Apr 6, 2020 at 10:55 AM Ifeanyi Chielo wrote: > Thanks to you all, I finally resolved the matter. I discovered it was jus

Re: Working with forms

2020-04-05 Thread Ifeanyi Chielo
Thanks to you all, I finally resolved the matter. I discovered it was just of a mix up of ModelForm and ordinary Django forms, though I enjoyed the teething challenges as a new django user Dr. Chielo C. Ifeanyi Chief Programmer, Head Webometrics Section ICT Unit, UNN 08032366433, 08154804230 ifeany

Re: Working with forms

2020-04-05 Thread Maro Okegbero Samuel
Port your code back to the initial state it was when you asked the question and on the template change *{{form}}* to *{{form.as_p}}* > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails f

Re: Working with forms

2020-04-05 Thread Alejandro Avendano
Hi Chielo, Actually, save() is a method of the class forms.ModelForm. But your form class is extending from forms.Form instead. Please, modify your form.py as follow: class NameForm (forms.ModelForm) class Meta: model = Namerec fields = ['your_name’,] On Sunday, April

Re: Working with forms

2020-04-05 Thread Ifeanyi Chielo
Please I am still left with the AttributeError, The form is now publishing fully and very well but it cannot save to the MySQL table. below is the error details and the recent code of view.py AttributeError at /namev/ 'NameForm' object has no attribute 'save' Request Method: POST Request URL: htt

Re: Working with forms

2020-04-05 Thread Ifeanyi Chielo
Thanks Dr. Chielo C. Ifeanyi Chief Programmer, Head Webometrics Section ICT Unit, UNN 08032366433, 08154804230 ifeanyi.chi...@unn.edu.ng http://www.unn.edu.ng/users/ifeanyichielo On Sun, Apr 5, 2020 at 6:35 PM Joshua Kayode wrote: > Ask questions here for immediate and

Re: Working with forms

2020-04-05 Thread Joshua Kayode
Ask questions here for immediate and detailed response djangoafrica.com and join the WhatsApp group, a community of professional django developers Group1 https://chat.whatsapp.com/IgJcwnZR9sr1Jatc5jnSx9 Group2: https://chat.whatsapp.com/DfOLbncTDkIKAvcm5lLm2Y Django africa is a community of djan

Re: Working with forms

2020-04-05 Thread Ifeanyi Chielo
I tried using the form. save() but it gave the same error message as with NameForm.save() Dr. Chielo C. Ifeanyi Chief Programmer, Head Webometrics Section ICT Unit, UNN 08032366433, 08154804230 ifeanyi.chi...@unn.edu.ng http://www.unn.edu.ng/users/ifeanyichielo On Sun, Ap

Re: Working with forms

2020-04-05 Thread KONE GOMPOU LOUA ALASSANE
Use form. save() because you asigned NameForm to form like Le dim. 5 avr. 2020 à 14:04, Ifeanyi Chielo a écrit : > I added the NameForm.Save() attribute and I had an AttributeError message > thus: > AttributeError at /namev/ > > type object 'NameForm' has no attribute 'save' > > Request Method:

Re: Working with forms

2020-04-05 Thread Ifeanyi Chielo
I added the NameForm.Save() attribute and I had an AttributeError message thus: AttributeError at /namev/ type object 'NameForm' has no attribute 'save' Request Method: POST Request URL: http://localhost:8000/namev/ Django Version: 2.1.5 Exception Type: AttributeError Exception Value: type objec

Re: Working with forms

2020-04-05 Thread Alejandro Avendano
Hi in the first version, you had: NameForm.is_valid(): NameForm.save() But on the second, version the "NameForm.save()" is missing. This is the line of code that save into you database. Maybe, should try putting it back... -- You received this message because you are subscribed to the Goo

Re: Working with forms

2020-04-04 Thread Ifeanyi Chielo
Thanks a lot, I believe I am close to the result. I did exactly what you instructed and another error appeared thus: ValueError at /namev/ The view pages.views.Namev_view didn't return an HttpResponse object. It returned None instead. Request Method: GET Request URL: http://localhost:8000/namev/

Re: Working with forms

2020-04-04 Thread Luqman Shofuleji
Okay, now the new error is that is not seeing that 'form' for the get request, you need to also add form = NameForm () before the if statement "if request.method == 'POST' " to handle the page get request. On Sat, Apr 4, 2020, 12:33 PM Ifeanyi Chielo wrote: > Thanks a lot, > I did as you said

Re: Working with forms

2020-04-04 Thread Ifeanyi Chielo
Screen shorts of codes available above Dr. Chielo C. Ifeanyi Chief Programmer, Head Webometrics Section ICT Unit, UNN 08032366433, 08154804230 ifeanyi.chi...@unn.edu.ng http://www.unn.edu.ng/users/ifeanyichielo On Sat, Apr 4, 2020 at 12:35 PM KONE GOMPOU LOUA ALASSANE <

Re: Working with forms

2020-04-04 Thread KONE GOMPOU LOUA ALASSANE
But i thing that this problem is due to bad indentation Le sam. 4 avr. 2020 à 11:34, KONE GOMPOU LOUA ALASSANE < gompou.k...@uvci.edu.ci> a écrit : > Send screen short > > Le sam. 4 avr. 2020 à 11:33, Ifeanyi Chielo a > écrit : > >> Thanks a lot, >> I did as you said and I encountered the error

Re: Working with forms

2020-04-04 Thread KONE GOMPOU LOUA ALASSANE
Send screen short Le sam. 4 avr. 2020 à 11:33, Ifeanyi Chielo a écrit : > Thanks a lot, > I did as you said and I encountered the error message below: > UnboundLocalError at /namev/ > > local variable 'form' referenced before assignment > > Request Method: GET > Request URL: http://localhost:800

Re: Working with forms

2020-04-04 Thread Ifeanyi Chielo
Thanks a lot, I did as you said and I encountered the error message below: UnboundLocalError at /namev/ local variable 'form' referenced before assignment Request Method: GET Request URL: http://localhost:8000/namev/ Django Version: 2.1.5 Exception Type: UnboundLocalError Exception Value: local

Re: Working with forms

2020-04-04 Thread Luqman Shofuleji
In def Namev_view under views.py, include form in the return parameter and see if that resolves the issue return render(request, 'namev.html', {'form':form}) On Sat, Apr 4, 2020, 1:35 AM Ifeanyi Chielo wrote: > Hello,I developed a form with a single field, but this form displays only > the su

Re: Working with forms

2020-04-04 Thread Ifeanyi Chielo
Ifeanyi Chielo < > ifeanyi.chi...@unn.edu.ng> > *Reply to: * > *Date: *Saturday, 04 April 2020 at 02:51 > *To: *Django users > *Subject: *Re: Working with forms > > > > Thanks Victor, > > I did it and it does not make any cnange > > > On Satur

Re: Working with forms

2020-04-04 Thread Ifeanyi Chielo
tml & urls.py. Also have you included the app > name in the settings.py? > > Thanks, > > > > Bruckner de Villiers > > 083 625 1086 > > > > *From: * on behalf of Ifeanyi Chielo < > ifeanyi.chi...@unn.edu.ng> > *Reply to: * > *Date: *Saturday, 04

Re: Working with forms

2020-04-03 Thread Bruckner de Villiers
Please share code for home.html & urls.py.  Also have you included the app name in the settings.py? Thanks, Bruckner de Villiers 083 625 1086 From: on behalf of Ifeanyi Chielo Reply to: Date: Saturday, 04 April 2020 at 02:51 To: Django users Subject: Re: Working with f

Re: Working with forms

2020-04-03 Thread Ifeanyi Chielo
Thanks Victor, I did it and it does not make any cnange On Saturday, April 4, 2020 at 1:41:19 AM UTC+1, victor awakan wrote: > > In the form template tag, shouldn’t it be {{ form.as_p}} tag? > > On Sat 4. Apr 2020 at 3.35, Ifeanyi Chielo > wrote: > >> Hello,I developed a form with a single field

Re: Working with forms

2020-04-03 Thread victor awakan
In the form template tag, shouldn’t it be {{ form.as_p}} tag? On Sat 4. Apr 2020 at 3.35, Ifeanyi Chielo wrote: > Hello,I developed a form with a single field, but this form displays only > the submit button at the browser as shown in the image below. Please how > can I correct this and also sa

Working with forms

2020-04-03 Thread Ifeanyi Chielo
Hello,I developed a form with a single field, but this form displays only the submit button at the browser as shown in the image below. Please how can I correct this and also save the field to the MySQL table. My code is also shown below [image: django form.png] View.py from django.http im

Re: working with forms , problem !!!

2011-12-12 Thread Alagappan
Adding the csrf context processor would fix it. Refer to https://docs.djangoproject.com/en/dev/ref/contrib/csrf/ for more details. As suggested, you can add your own render_to_response() wrapper, if you are likely to use it often. -- *Regards,* *Alagappan Ramu (http://alagappan.co.in) * -- You

Re: working with forms , problem !!!

2011-12-11 Thread Mario Gudelj
Try using this: d = {'form':form} d.update(csrf(request)) return render_to_response('contact.html',d) Tip: don't use !!! or ??? in your emails when asking for help :) On 12 December 2011 08:30, Hassan wrote: > Dear All , > am trying to make a form and i used an example from the book but its

working with forms , problem !!!

2011-12-11 Thread Hassan
Dear All , am trying to make a form and i used an example from the book but its not working , dont know why ? this is what i have : models.py : from django.db import models from django import forms class ContactForm(forms.Form): subject = forms.CharField(max_length=100) message

Re: Working with Forms and Session Variables

2009-02-11 Thread Daniel Roseman
On Feb 11, 4:11 pm, gbd wrote: > Another point (sorry I should have said this in my original post) > > My form is bound > i.e. in my view > form = RecipeForm(request.POST) > I don't believe that I can use initial in this case? > > please let me know if I've misunderstood > > thanks again! > > On

Re: Working with Forms and Session Variables

2009-02-11 Thread gbd
Thanks for all your help it's much appreciated. I will work with both methods and see if i can get them to work! Thanks again On Feb 11, 12:13 pm, Daniel Roseman wrote: > On Feb 11, 4:11 pm, gbd wrote: > > > > > Another point (sorry I should have said this in my original post) > > > My form is

Re: Working with Forms and Session Variables

2009-02-11 Thread gbd
Another point (sorry I should have said this in my original post) My form is bound i.e. in my view form = RecipeForm(request.POST) I don't believe that I can use initial in this case? please let me know if I've misunderstood thanks again! On Feb 11, 11:06 am, gbd wrote: > Thanks! > > A foll

Re: Working with Forms and Session Variables

2009-02-11 Thread gbd
Thanks! A follow up question - Would i exclude that field in my class description? i.e. class RecipeForm(forms.ModelForm): class Meta: model = Recipes exclude = ('user',) On Feb 11, 10:54 am, Daniel Roseman wrote: > On Feb 11, 3:20 pm, gbd wrote: > > >

Re: Working with Forms and Session Variables

2009-02-11 Thread Daniel Roseman
On Feb 11, 3:20 pm, gbd wrote: > Hello, > > I am presently working on my first Django project and seemed to be a > little stuck concerning session variables and forms. > > This is how my app is laid out: > - user logs in and is directed to a "you have successfully logged in" > page > - user is th

Working with Forms and Session Variables

2009-02-11 Thread gbd
Hello, I am presently working on my first Django project and seemed to be a little stuck concerning session variables and forms. This is how my app is laid out: - user logs in and is directed to a "you have successfully logged in" page - user is then redirected to what i am hoping to be an accou