Questions tagged as 'python'

1
answer

C # fixes vs Python lists

In Python the lists could contain other lists for example lista = ["x",["a","b"],["c","d"],"z"]; print lista[1][1]>>>>>>>>>> output "b" my question is ... in c # can other fixes be contained in an array...
asked by 30.04.2017 / 16:26
1
answer

Place Materialize CSS to FileField - Django

I am trying to use the File_CSS from Materialize but I can not find a way to make it work for me. This is my model: class ComprobanteDomicilio(models.Model): alumno = models.ForeignKey(Alumno, on_delete=models.CASCADE) url_documen...
asked by 30.04.2017 / 09:52
1
answer

Heroku - heroku run python manage.py migrate error

I'm trying to migrate through heroku to log in with fb but when I run the command heroku run python manage.py migrate the following happens (I'm supposed to have already done diployed in heroku): >>> heroku run python manage.py...
asked by 01.05.2017 / 04:15
1
answer

Problems in data rendering django with annotate [closed]

In the view.py I have a query like this ing =ingresos.objects.filter(pk=id_jovenclub).values('natural').annotate(sum=Sum('natural')) in the template is like this {{ ing}} and it returns these values [{'sum': 1066.0, 'natural': 1066...
asked by 02.05.2017 / 20:23
1
answer

like knowing what comes after a specific character in a string in python

for example I have this chain the Red car. and I want to know if after that. another word comes I had thought of this solution cadenaaux = "el carro rojo.casa" if (cadenaaux.count('.') > 0 and cadenaaux[-1] != '.'): but the last position...
asked by 07.05.2017 / 04:52
1
answer

scipy.optimize.newton, How to declare the derivative?

Of the libreria Scipy to use the metodo de Newton I have to declare the functions and the parameters scipy.optimize.newton(func, x0, fprime=None, args=(), tol=1.48e-08, maxiter=50, fprime2=None) The problem is that when I de...
asked by 28.03.2017 / 17:42
3
answers

help txt files in python

Good evening Veran I am new to python and I need someone to explain to me how to do save an information x in txt file for example: student: carlos rojas age: 29 Address: alajuela telefo: 2222222 student: luis perez age: 18 Address: here...
asked by 07.04.2017 / 05:48
1
answer

builtins.KeyError KeyError: 'SQLALCHEMY_TRACK_MODIFICATIONS' (Flask-python)

I am a student. I've been trying to solve this error for hours and I can not find a way to do it: This is the complete error: builtins.KeyError KeyError: 'SQLALCHEMY_TRACK_MODIFICATIONS' Traceback (most recent call last) File "C:\Users\Mar...
asked by 24.03.2017 / 19:15
1
answer

Something is wrong with a Django model

You see, I have created a model which is used to link a comment to a user. This is the code models.py: class mensajeria(models.Model): texto=RichTextField(max_length=300) usuario=models.OneToOneField(User) def __srt__(self):...
asked by 26.05.2017 / 13:14
2
answers

Display information according to the logged in user, ListView class? - Django

models.py class Torneo(models.Model): user = models.ForeignKey(User) descripcion = models.CharField(max_length=200) def __str__(self): return (self.descripcion) views.py class Torneo_ListView(ListView): template_...
asked by 31.03.2017 / 23:47