mysql client error

2018-10-13 Thread highnes joseph
how to fix pip install mysqlclient error?

-- 
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-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/233b7426-cd70-45c2-bbb2-fd9cc367cf60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Curso:2.1-Spanish] Django: Creando una aplicación Completa

2018-10-13 Thread Daniel Bojorge (Foros)
CURSO DJANGO: CREANDO UNA APLICACIÓN COMPLETA (Único con Django 2.1 en 
español)

===> https://goo.gl/oeT5Sx <=== (94% Descuento)

#Curso #Django #Clase #Migration #Python #PostgreSQL #Course
Luego de crear el modelo (lo vemos cómo se hizo), procedemos a generar la 
primer migración, para luego aplicarla.

Vemos el estado de la base de datos previo a la aplicación y luego cómo se 
crea la tabla en base al modelo.

Todo esto y mucho más en el curso de DJANGO. Te invito a que lo tomes en el 
provisto inicialmente.

Si te ha sido de utilidad esta clase o crees que puede ayudarle a otra 
persona, te pido la compartas.

 https://goo.gl/oeT5Sx 


 https://goo.gl/oeT5Sx 
Gracias por apoyarme en este nuevo mundo de hacer cursos.

https://youtu.be/iyqRbequFpY


Thanks for share this post.

-- 
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-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4f718f3e-6344-4cfe-a95f-542da0a0eb5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: login() got an unexpected keyword argument 'template_name'

2018-10-13 Thread Daniel Bojorge (Foros)
I suggest you that you use path in the url file.  I made an implemantation 
of login like this

from django.urls import include, path
from django.contrib.auth import views as auth_views

from generales.views import Home, SinPrivilegios, HomeSinPrivilegios

urlpatterns = [
path('', Home.as_view(), name='home'),
path('login/', 
auth_views.LoginView.as_view(template_name='generales/login.html'), 
name='login'),
path('logout/', auth_views.LogoutView.as_view
 (template_name='generales/login.html'), name='logout'),
path('sin_privilegios/', HomeSinPrivilegios.as_view(), 
name='sin_privilegios')

]

How you can see, just import the auth views (wiht aliases) and just put in 
parameter the name of the template_name.  And work for me.

All this (and more) I covered in my course about Django 2.1, 
https://goo.gl/oeT5SxTake a look.  It is in spanish, but may be I can 
help you if you register.

El miércoles, 10 de octubre de 2018, 20:38:05 (UTC-6), Yonggang Dai 
escribió:
>
> HI! I am having issues with django login . I want to use the default  
> login class with the html file "login.html". But  I meet the below issue.
> Please  help me to fix it. Thanks  a lot.
>
> [image: image.png]
>

-- 
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-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0e242e16-d070-4ce7-91fe-fc2ce479fdcf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Permission to views

2018-10-13 Thread Daniel Bojorge (Foros)
Hi, I made this course (in spanichs), but I try this topic.  DJANGO 
2.1  https://goo.gl/oeT5Sx 

First use Mixin, they must to go from left to right in the views 
declaration, after the type of generic view.  In the course I used 
the PermissionRequiredMixin and this use the permission_required  property.

I hope answer your question.. Excuse me my English.

El jueves, 11 de octubre de 2018, 4:59:40 (UTC-6), Django Girls Bauchi 
escribió:
>
>
>
> Hello guys, am creating an all that needs permission to certain view, no
> login permission, sort of access or eligibility permission..
>
> Any ideas???
>

-- 
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-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fd796bc8-a2f2-4cf0-adcf-baa01578cc73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: beginner guide

2018-10-13 Thread Daniel Bojorge (Foros)
I made this course, I hope be useful for you  https://goo.gl/oeT5Sx   It's 
in spanish.


El lunes, 8 de octubre de 2018, 10:39:29 (UTC-6), Ashok Reddy escribió:
>
> hello every one .i am beginner to Django. Could you please suggest me the 
> best source to learn,i am very enthusiastic to learn.
>

-- 
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-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9d29b158-c9f6-4a4b-ba79-07a311889812%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: mysql client error

2018-10-13 Thread Joel
What exactly is the error?

On Sat, 13 Oct, 2018, 6:56 PM highnes joseph,  wrote:

> how to fix pip install mysqlclient error?
>
> --
> 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-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/233b7426-cd70-45c2-bbb2-fd9cc367cf60%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_95pbrpOqOtDHNax1ym%2BxahJcxf%3Djyp%3DFokH9A6pKv8dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problems with code in shell (Django 2 and python 3.6)

2018-10-13 Thread Luis Enrique Gonzalez D
It's possible that exist and confusion using libraries due to the versions
of python. Try this in the import :

from datetime import datetime


El vie., 12 oct. 2018 a las 16:07, User1 () escribió:

> Hello, I am practicing the tutorial part 5, Test and I got an error I can
> solve.
> The code in shell is:
>
> (mientorno) C:\Users\user1\djangowom>python manage.py shell
> Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 18:11:49) [MSC v.1900 64 bit
> (AMD64)]
>  on win32
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
> >>>
> >>>
> >>>
> >>> import datetime
> >>> from django.utils import timezone
> >>> from polls.models import Question
> >>> future_question = Question(pub_date=timezone.now() +
> datetime.timedelta(days=30))
> >>> future_question.was_published_recently()
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "C:\Users\arojas\djangowom\polls\models.py", line 12, in
> was_published_re
> cently
> return self.pub_date >= timezone.now() - datetime.timedelta(days=1)
> AttributeError: type object 'datetime.datetime' has no attribute
> 'timedelta'
> >>>
>
> Any idea? Thanks a lot.
>
> --
> 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-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6fe58b1b-f6d5-41b6-9193-ff00d938420f%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB6zZ72-S_ZBT_35C8H934kk-vGY8XipPenq3Wkm7NuuegHp8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Instagram embedding

2018-10-13 Thread Mikko Meronen
Hi,

I'm trying to embed Instagram to my development site by using a Instagram
embedding code, but when I add it to my html, I get the error below.

I would appreciate a lot if someone could help me to understand the error
and solve the problem.

Best regards,

- Mikko

UnicodeDecodeError at /news/

'utf-8' codec can't decode byte 0xe4 in position 7333: invalid continuation byte

Request Method: GET
Request URL: http://127.0.0.1:8000/news/
Django Version: 2.1
Exception Type: UnicodeDecodeError
Exception Value:

'utf-8' codec can't decode byte 0xe4 in position 7333: invalid continuation byte

Exception Location: C:\Users\Mikko\django-project\lib\codecs.py in decode,
line 321
Python Executable: C:\Users\Mikko\django-project\Scripts\python.exe
Python Version: 3.6.4
Python Path:

['C:\\Users\\Mikko\\django-project\\topi',
 'C:\\Users\\Mikko\\django-project\\Scripts\\python36.zip',
 'C:\\Users\\Mikko\\django-project\\DLLs',
 'C:\\Users\\Mikko\\django-project\\lib',
 'C:\\Users\\Mikko \\django-project\\Scripts',
 'c:\\python36-32\\Lib',
 'c:\\python36-32\\DLLs',
 'C:\\Users\\Mikko\\django-project',
 'C:\\Users\\Mikko\\django-project\\lib\\site-packages']

Server time: Sat, 13 Oct 2018 14:25:38 +
Unicode error hint

The string that could not be encoded/decoded was: *;"> N�yt� t*
Error during template rendering

In template C:\Users\Mikko\django-project\topi\news\templates\news\home.html,
error at line *1*
utf-8
1 {% extends 'news/base.html' %}

-- 
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-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGD0jjKCjY0Gz%2BGqz5uAETvmR_Fw%3Df56EvNBaqeLt1gr4c6N3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to save multiple model form in one template?

2018-10-13 Thread Daniel Bojorge (Foros)
Take a look to my course (in spanish) and go to the last CRUD, there I do a 
Master-Detail form, the detail form are many models

 DJANGO 2.1  https://goo.gl/oeT5Sx 

El viernes, 7 de septiembre de 2018, 4:43:11 (UTC-6), Django Lover escribió:
>
>
> I have one page, which I have to show three model form and three 
> different submit button for each.
>
> My question is how I can save these three form individually?
>
> FOLLOWING IS CODE:-
>
> **form.py**
>
>
> class UserTaxesMultiForm(MultiModelForm):
>form_classes = {
>'user_tax_form': MyForm,
>'user_discount_form': DiscountForm,
>'user_shiping_form': ShipmentForm,
>}
>
> *Note- myForm, DiscountForm, ShipmentForm are model forms. like following-*
>
> class MyForm(forms.ModelForm):
>prefix = 'tax'
>class Meta:
>model = StUserTaxDetails
>fields = ('tax_name', 'tax_rate')
>  
>tax_name = forms.CharField(max_length=10,
> widget=forms.TextInput(),
> required=True, label="tax name")
>
> tax_rate = forms.FloatField(required=True,  label="tax rate")
>
>
> error_messages  = {
>'required': _('fields are required.'),
>}
>
> def clean_title(self):
>return self.cleaned_data['tax_name']
>
> def clean(self):
>tax_name = self.cleaned_data.get('tax_name')
>tax_rate = self.cleaned_data.get('tax_rate')
> 
> if not tax_name and not tax_rate:
>raise forms.ValidationError(
>self.error_messages['required'],
>code='required',
>)
>return self.cleaned_data
>
> **view.py**
> class AddTaxView(LoginRequiredMixin, CreateView):
>template_name = 'invoices/add_tax.html'
>form_class = UserTaxesMultiForm
>success_url = '/add/tax/'
>
>*{WHAT IS THE CODE HERE FOR THE POST METHOD TO SAVE DATA ACORDING 
> DIFFRENT FORM SUBMIT} *
> 
>
>
>
> **HTML**
>
>
>
> 
> {% form.user_tax_form%}
>
> 
> 
>
> 
> {% form.user_discount_form%}
>
> 
> 
>
> 
> {% form.user_shiping_form%}
>
> 
> 
>
> PLEASE HELP
>

-- 
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-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6643b26e-d00d-438d-9d24-d383c857fada%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to save multiple model form in one template?

2018-10-13 Thread Joel Mathew
Could you kindly stop spamming your course details over over this
discussion group. It's not useful to the majority of us English speaking
people.




On Sat, 13 Oct 2018 at 20:41, Daniel Bojorge (Foros) 
wrote:

> Take a look to my course (in spanish) and go to the last CRUD, there I do
> a Master-Detail form, the detail form are many models
>
>  DJANGO 2.1  https://goo.gl/oeT5Sx
>
> El viernes, 7 de septiembre de 2018, 4:43:11 (UTC-6), Django Lover
> escribió:
>>
>>
>> I have one page, which I have to show three model form and three
>> different submit button for each.
>>
>> My question is how I can save these three form individually?
>>
>> FOLLOWING IS CODE:-
>>
>> **form.py**
>>
>>
>> class UserTaxesMultiForm(MultiModelForm):
>>form_classes = {
>>'user_tax_form': MyForm,
>>'user_discount_form': DiscountForm,
>>'user_shiping_form': ShipmentForm,
>>}
>>
>> *Note- myForm, DiscountForm, ShipmentForm are model forms. like
>> following-*
>>
>> class MyForm(forms.ModelForm):
>>prefix = 'tax'
>>class Meta:
>>model = StUserTaxDetails
>>fields = ('tax_name', 'tax_rate')
>>
>>tax_name = forms.CharField(max_length=10,
>> widget=forms.TextInput(),
>> required=True, label="tax name")
>>
>> tax_rate = forms.FloatField(required=True,  label="tax rate")
>>
>>
>> error_messages  = {
>>'required': _('fields are required.'),
>>}
>>
>> def clean_title(self):
>>return self.cleaned_data['tax_name']
>>
>> def clean(self):
>>tax_name = self.cleaned_data.get('tax_name')
>>tax_rate = self.cleaned_data.get('tax_rate')
>>
>> if not tax_name and not tax_rate:
>>raise forms.ValidationError(
>>self.error_messages['required'],
>>code='required',
>>)
>>return self.cleaned_data
>>
>> **view.py**
>> class AddTaxView(LoginRequiredMixin, CreateView):
>>template_name = 'invoices/add_tax.html'
>>form_class = UserTaxesMultiForm
>>success_url = '/add/tax/'
>>
>>*{WHAT IS THE CODE HERE FOR THE POST METHOD TO SAVE DATA ACORDING
>> DIFFRENT FORM SUBMIT} *
>>
>>
>>
>>
>> **HTML**
>>
>>
>>
>> 
>> {% form.user_tax_form%}
>>
>> 
>> 
>>
>> 
>> {% form.user_discount_form%}
>>
>> 
>> 
>>
>> 
>> {% form.user_shiping_form%}
>>
>> 
>> 
>>
>> PLEASE HELP
>>
> --
> 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-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6643b26e-d00d-438d-9d24-d383c857fada%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_-QFgL1DEZMmYMzpZRUcr5aY%2BGCBv_dJJB%3DdgyRyJJwQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to save multiple model form in one template?

2018-10-13 Thread Ing.Daniel Bojorge
ok

Dios L@s Bendiga

Saludos,



[image: --]

daniel.bojorge
[image: http://]about.me/daniel.bojorge

 Mi Blog 
Nicaragua

"Si ustedes permanecen unidos a mí, y si permanecen fieles a mis
enseñanzas, pidan lo que quieran y se les dará.
(Juan 15:7 DHH)
Bendito el varón que se fía en el SEÑOR, y cuya confianza es el SEÑOR.
(Jeremías 17:7 RV2000)



El sáb., 13 oct. 2018 a las 9:16, Joel Mathew () escribió:

> Could you kindly stop spamming your course details over over this
> discussion group. It's not useful to the majority of us English speaking
> people.
>
>
>
>
> On Sat, 13 Oct 2018 at 20:41, Daniel Bojorge (Foros) 
> wrote:
>
>> Take a look to my course (in spanish) and go to the last CRUD, there I do
>> a Master-Detail form, the detail form are many models
>>
>>  DJANGO 2.1  https://goo.gl/oeT5Sx
>>
>> El viernes, 7 de septiembre de 2018, 4:43:11 (UTC-6), Django Lover
>> escribió:
>>>
>>>
>>> I have one page, which I have to show three model form and three
>>> different submit button for each.
>>>
>>> My question is how I can save these three form individually?
>>>
>>> FOLLOWING IS CODE:-
>>>
>>> **form.py**
>>>
>>>
>>> class UserTaxesMultiForm(MultiModelForm):
>>>form_classes = {
>>>'user_tax_form': MyForm,
>>>'user_discount_form': DiscountForm,
>>>'user_shiping_form': ShipmentForm,
>>>}
>>>
>>> *Note- myForm, DiscountForm, ShipmentForm are model forms. like
>>> following-*
>>>
>>> class MyForm(forms.ModelForm):
>>>prefix = 'tax'
>>>class Meta:
>>>model = StUserTaxDetails
>>>fields = ('tax_name', 'tax_rate')
>>>
>>>tax_name = forms.CharField(max_length=10,
>>> widget=forms.TextInput(),
>>> required=True, label="tax name")
>>>
>>> tax_rate = forms.FloatField(required=True,  label="tax rate")
>>>
>>>
>>> error_messages  = {
>>>'required': _('fields are required.'),
>>>}
>>>
>>> def clean_title(self):
>>>return self.cleaned_data['tax_name']
>>>
>>> def clean(self):
>>>tax_name = self.cleaned_data.get('tax_name')
>>>tax_rate = self.cleaned_data.get('tax_rate')
>>>
>>> if not tax_name and not tax_rate:
>>>raise forms.ValidationError(
>>>self.error_messages['required'],
>>>code='required',
>>>)
>>>return self.cleaned_data
>>>
>>> **view.py**
>>> class AddTaxView(LoginRequiredMixin, CreateView):
>>>template_name = 'invoices/add_tax.html'
>>>form_class = UserTaxesMultiForm
>>>success_url = '/add/tax/'
>>>
>>>*{WHAT IS THE CODE HERE FOR THE POST METHOD TO SAVE DATA ACORDING
>>> DIFFRENT FORM SUBMIT} *
>>>
>>>
>>>
>>>
>>> **HTML**
>>>
>>>
>>>
>>> 
>>> {% form.user_tax_form%}
>>>
>>> 
>>> 
>>>
>>> 
>>> {% form.user_discount_form%}
>>>
>>> 
>>> 
>>>
>>> 
>>> {% form.user_shiping_form%}
>>>
>>> 
>>> 
>>>
>>> PLEASE HELP
>>>
>> --
>> 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-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/6643b26e-d00d-438d-9d24-d383c857fada%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAA%3Diw_-QFgL1DEZMmYMzpZRUcr5aY%2BGCBv_dJJB%3DdgyRyJJwQQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/d

Re: Instagram embedding

2018-10-13 Thread Mikko Meronen
Hi,

It worked in production environment well, just not in development
environment.

- Mikko

la 13. lokak. 2018 klo 17.39 Mikko Meronen (mikkovillemero...@gmail.com)
kirjoitti:

> Hi,
>
> I'm trying to embed Instagram to my development site by using a Instagram
> embedding code, but when I add it to my html, I get the error below.
>
> I would appreciate a lot if someone could help me to understand the error
> and solve the problem.
>
> Best regards,
>
> - Mikko
>
> UnicodeDecodeError at /news/
>
> 'utf-8' codec can't decode byte 0xe4 in position 7333: invalid continuation 
> byte
>
> Request Method: GET
> Request URL: http://127.0.0.1:8000/news/
> Django Version: 2.1
> Exception Type: UnicodeDecodeError
> Exception Value:
>
> 'utf-8' codec can't decode byte 0xe4 in position 7333: invalid continuation 
> byte
>
> Exception Location: C:\Users\Mikko\django-project\lib\codecs.py in
> decode, line 321
> Python Executable: C:\Users\Mikko\django-project\Scripts\python.exe
> Python Version: 3.6.4
> Python Path:
>
> ['C:\\Users\\Mikko\\django-project\\topi',
>  'C:\\Users\\Mikko\\django-project\\Scripts\\python36.zip',
>  'C:\\Users\\Mikko\\django-project\\DLLs',
>  'C:\\Users\\Mikko\\django-project\\lib',
>  'C:\\Users\\Mikko \\django-project\\Scripts',
>  'c:\\python36-32\\Lib',
>  'c:\\python36-32\\DLLs',
>  'C:\\Users\\Mikko\\django-project',
>  'C:\\Users\\Mikko\\django-project\\lib\\site-packages']
>
> Server time: Sat, 13 Oct 2018 14:25:38 +
> Unicode error hint
>
> The string that could not be encoded/decoded was: *;"> N�yt� t*
> Error during template rendering
>
> In template
> C:\Users\Mikko\django-project\topi\news\templates\news\home.html, error
> at line *1*
> utf-8
> 1 {% extends 'news/base.html' %}
>

-- 
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-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGD0jj%2BOn0d1mVx1Fq7B7-XEKQxPiBWT6QLts8sWrUkAFwUAng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django admin widget

2018-10-13 Thread Ryan Nowakowski
I've done something similar in the past but I use a separate model for author 
that has a foreign key back to book. You can limit the number of authors to 3 
in the author save method.

Then you can use an inline form for author in the admin. That will give you the 
+ functionality you're looking for.

If you want to keep you current book model the same with authors as fields, 
take a look at admin fieldsets.

On October 12, 2018 8:43:26 PM CDT, thebobbobs...@gmail.com wrote:
>Hi,
>I'm still a bit new to django, but making slow progress.
>
>I'm wondering how to move forward with a book class as model which has
>an 
>author field which
>allows adding additional authors.
>
>I have three fields allocated in the SQLite db for up to three
>different 
>authors.
>
>What I'm trying to do is only expose the additional author text entry
>box 
>for the book class in admin
>when say for example a plus or other widget is clicked.
>
>ex.  Author [  ]  +
>...then
>  Additional Author1 [ ]  +
>...and finally
>  Additional Author2 [ ]
>
>So if you click the plus the additional author1 text entry shows up,
>then 
>click again the last or third
>author entry shows up, but no more plus we're out of db fields at that 
>point.
>
>Not trying to dynamically add fields to the db.  Just expose when
>needed 
>for up to three authors.
>
>Prefer to not use jquery and/or javascript, but stick to pure python
>django 
>if possible.
>
>I've been reading alot about admin but still confused as to best way to
>
>proceed.
>
>Thank You,
>
>-- 
>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-users@googlegroups.com.
>Visit this group at https://groups.google.com/group/django-users.
>To view this discussion on the web visit
>https://groups.google.com/d/msgid/django-users/39694849-09dd-47b7-8b16-deed352e8785%40googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.

-- 
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-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/38283332-0AB7-4F6B-93E2-F4BD347CAFD6%40fattuba.com.
For more options, visit https://groups.google.com/d/optout.