As far as I know the Django ORM encapsulates SQL queries, so you can't put
arbitrary python code in there (".strip()")
If I remember correctly SQL does not have a standard TRIM method, but
individual database engines do, for example for Postgres
http://www.postgresql.org/docs/9.1/static/functions
duplicated queries as in exactly the same or with different parameters? If
they hace different parameters it sounds like something you can resolve
with select_related
https://docs.djangoproject.com/en/1.8/ref/models/querysets/#select-related
Either way, you would need to post you rmodels and quer
It seems you don't have any groups in your database with the name "test"
On Wed, Nov 11, 2015 at 7:14 PM, Robin Fourcade
wrote:
> Hi,
> I'm working with the auth library.
>
> I've imported all of these:
>
> from django.shortcuts import render, redirect
> from pizza_club_order.forms import *
> fr
You have two pairs of fields with the same name (line_item_id
and invoice_id), what are you trying to do exactly? Why the IntegerFields?
In a Many To Many relation the columns are added to a third table between
the models.
On Tue, Dec 22, 2015 at 9:20 PM, Michael Molloy wrote:
> Python 3.3 and
If you want to make the middle table by yourself then those ManyToManyField
need to be ForeignKey instead.
On Wed, Dec 23, 2015 at 2:33 AM, Michael Molloy wrote:
> I figured it out, again with help from Vijay. Thanks for getting me
> thinking in the right direction.
>
> So here
I guess the URL would be something like this
127.0.0.1:8000/static/my_app/hello.html
(without the first "my_app")
assuming your STATIC_URL is '/static/'
On Wed, Dec 23, 2015 at 1:57 AM, Dan Bikle wrote:
> *Hi List,*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
You should be able to query it as a ForeignKey
Jobs.objects.filter(names__is_a_problem=True).distinct()
(distinct to prevent repeated jobs with more than one worker problem)
On Wed, Dec 23, 2015 at 9:31 AM, Jonty Needham
wrote:
> I have a model of the form:
>
> class Jobs(models.Model):
>
"First, why does uf.is_valid() return"
because you called "uf.is_valid" (note the lack of parenthesis), that's
just a reference to the method and does not call it.
"Second, why does uf.save() return that stacktrace the first time I call
it, but the second time I call it, the object saves? "
As f
g, but it doesn't work. Note
> the code below. is_bound = False if I use instance=u. If I just pass the
> Users instance without the 'instance' keyword, is_bound returns True.
>
> >>> u = Users()
>
> >>> u.email = 'je...@home.net'
>
>
Try with
self.request.GET['name']
On Sun, Jan 3, 2016 at 11:22 PM, Víctor Suárez
wrote:
> Hello all,
> as it's my first post, if any django developer around, nice work! I
> appreciate the package, I've been able to pull a small project I had in
> mind for long, very easily with this.
>
> I am n
I usually do
product.id = None
product.pk = None
But I'm not sure whether that's the best way to do it
On Mon, Jan 11, 2016 at 4:25 AM, Xudong Zhang wrote:
> I want to delete the id attribute of a model but failed, it comlains that
> the model has no attribute 'id'. But I use hasattr() checked
At least I use it as part of the process to save a copy of an existing
model instance
On Mon, Jan 11, 2016 at 9:35 AM, Tony Flury
wrote:
> Why do you want to delete the id field. The idea of a primary key field is
> central to relational databases. If you to suppress the automatically
> generate
At least to me it doesn't make a lot of sense to define new models in your
tests, but I also don't know the particular problem you are solving.
On Sat, Jan 16, 2016 at 1:27 PM, Brutus Schraiber wrote:
> Wrong place to ask such things?
>
> This doesn't seem too uncommon or complicated, or am I mi
your app is called "generator", that's all you need to put in INSTALLED APPS
also, I'm not sure if this matters, but I tend to put my apps after the
ones bundled with django.
On Sat, Jan 16, 2016 at 5:30 PM, ofeyofey wrote:
> Hi,
>
> I am following the Django tutorial on the Django site. Gettin
assert test_obj not in TestObj.objects.filter(Q(m2ms__int_value=10) &
Q(m2ms__char_value='bar'))
Why shouldn't test_obj be in that query result? test_obj has a m2m with
int_value 10 and a m2m (although another one) with char_value bar
On Sat, Feb 13, 2016 at 7:45 PM, Lucas Wiman wrote:
> I'm wo
Each product is only associated with one category, so you can only do
produto.categoria
If you want to iterate over all categories, and then through the products
of each category, you could do
{% for categoria in categorias %}
{% for produto in categoria.produto_set.all %}
do comething with prod
Django 'is' a framework, therefore you have the flexibility to create your
context as you see fit. You could call an external API, query your
database, obtain results from ElasticSearch, parse another webpage, or
anything that suits the needs of your particular project.
It completely depends on th
{{ codelist.arrow }}
shouldn't you be using the for variable? something like
{{ i.arrow }}
On Thu, Feb 25, 2016 at 11:19 AM, Malik Rumi wrote:
> *Note- This question was originally posted on SO before I completely
> understood what my issue was. However, since editing it to reflect the true
The error you are seeing is at the application level, not database, so I
don't think postgres is at fault.
Post the full stack trace for the error and the relevant part of your code
when it fails.
On Sat, Mar 5, 2016 at 3:28 PM, Georges H wrote:
> Hi to all the Django community !
>
> I started
t I solved this little problem by adding at the top of my
> models.py:
>
> django.utils.encoding import from python_2_unicode_compatible
>
>
> And always in models.py before each class:
>
> @ python_2_unicode_compatible
>
> Perfect!
>
> Le dimanche 6 mars 2016
Leiste el tutorial?
https://docs.djangoproject.com/en/1.9/intro/tutorial01/
On Sat, Apr 2, 2016 at 3:25 AM, Kike Martinez
wrote:
> Hola quisiera saber como puedo hacer un proyecto con Djando desde cero
> gracias
>
> --
> You received this message because you are subscribed to the Google Groups
Your apps are called members and posts, or those are the names of the
models?
On Wed, Apr 6, 2016 at 9:20 AM, ludovic coues wrote:
> Both error look like encoding error.
> In the JS file, it look like there is a byte order mark at the start
> of the file.
> The first line of both file might help
Chilean Django dev here
We are not many, but at least there are plenty of Python developers here.
Regards!
On Thu, Apr 7, 2016 at 12:24 PM, John wrote:
> Curious to connect with Django devs in Chile.
>
> Hoping to do a Django project with Chilean devs in the coming months and
> would love to c
Your question seems to be incomplete
considering you are using a login_required decorator then you also want to
limit access to the file
If you put it in your static directory then it will be public if anyone
knows the URL to the file
On Sat, Apr 9, 2016 at 1:56 PM, Luca Brandi wrote:
> Hi,
>
Also, you don't need to restart Apache / nginx or whatever, or delete the
pyc files, just reload uwsgi / gunicorn.
On Tue, Apr 19, 2016 at 6:48 PM, Avraham Serour wrote:
> you can easily do code reloading with uwsgi graceful reload, no user will
> ever know you reloaded your application, no need
Why would you want to access request.body directly? You should use
request.POST, request.GET, request.FILES.
On Wed, Apr 20, 2016 at 5:27 PM, Mihai Corciu wrote:
> Is there a method to access request.body from a POST request in Django,
> without disabling 'django.middleware.csrf.CsrfViewMiddlewa
What could be in the body that's not in the supplied Django fields?
I have implemented RESTful APIs as you say (no idea why that matters as
they are just HTTP requests) and never had the need to read the actual
body..
On Thu, Apr 21, 2016 at 2:13 AM, Gergely Polonkai
wrote:
> Vijay:
I'm not sure why your code does not work (maybe there is a "race condition"
between the JS click handlers), but that global variable is a bad idea in
general.
You can add the comment ID as an attribute to your button, like
and in your event handler obtain the comment id
$("#like_comment_button
En general SSH sirve para hacer conexiones remotas por terminal (bueno,
puedes hacer una sesión X a través de SSH pero no creo que sea lo que
necesites)
La forma más común de aumentar la seguridad del login es por two factor
authorization, básicamente mandar una validación a tu celular o algun otr
"Vijay, thanks for the help, but the authentication of two factors seems
quite uncomfortable, considering that an administrator can enter every day,
several times a day, having to depend on a mobile device for each login.
"
Session cookies last for 2 weeks by default in Django, regardl
La máxima seguridad (razonable) sería conectarse a una VPN y que el admin
de Django solo acepte logins desde dentro de la VPN, pero para el 99% de
los casos suena innecesario.
Para abrir un navegador dentro del servidor mismo tendrías que tener
instalado todo ambiente de escritorio en el servidor
As far as I know you can't do it directly in the templating system
Yo could write a template tag as described here
https://stackoverflow.com/questions/2894365/use-variable-as-dictionary-key-in-django-template/10700142#10700142
or use a different data structure, for example each row as a list of
You can also use PubNub (https://www.pubnub.com/) or similar services
On Mon, Jul 2, 2018 at 10:29 AM Vineeth Sagar wrote:
> Mikhailo Keda wrote:
>>
>> to fetch emails every N minutes or hours -
>> http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html
>> I want the user to
django rest framework would be your best bet
http://www.django-rest-framework.org/
On Mon, Jul 16, 2018 at 10:16 AM micka
wrote:
> Hello,
>
> I wish I could use the data from an external API in the administration of
> Django. I wish I could list, read, edit and create objects but instead of
> u
Maybe your update form has a field related to a model with thousands of
records? like rendering a select combo box with thousands of choices?
On Thu, Aug 23, 2018 at 5:30 PM Jim Illback wrote:
> I have a Django app in development that performed perfectly with about 20
> client records. Each clie
On Thu, Aug 23, 2018 at 8:19 PM Jim Illback wrote:
> Vijay, you are exactly correct. Thank you much!
>
> Now, knowing the problem, I still don’t have a great solution. Here’s how
> it is supposed to work.
>
> Someone chooses a client from the list or a search. All the possibl
you want to be editable by the user
On Fri, Aug 24, 2018 at 2:06 PM Jim Illback wrote:
> Vijay, think of this is a parent - child relationship. I have 37K parents.
> Now I want to update a child of one of the parents. But, in order to have
> the update work, it needs the ForeignKey t
If you're using django-storages with S3 as the media backend then there is
a setting called AWS_S3_FILE_OVERWRITE that prevents files with the same
name form being uploaded. In those cases the library appends a suffix
similar to your example.
Usually this is useful to prevent files from being over
Since the related name in the project foreign key is "review" you have to
use that keyword for the related query from project, so it should be
"self.review.all()" instead of "self.review_set.all()" in your Project
methods.
Regards!
On Fri, Oct 12, 2018 at 9:25 AM Melissa Malala
wrote:
> Getting
You can also try get_user(request) instead of request.user
Or also self.requesr.user if you take self as argument.
Let me know if it works for you
Cheers
Vijay
On Tue, Dec 15, 2020, 23:56 Chelsea Fan
wrote:
> [image: image.png]
>
> --
> You received this message because you are s
but still not sure what is the right way to do it.
Any help would be appreciated. Thanks in advance.
Have a nice day.
Regards
Vijay
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving e
to me at
vijaynaudiyal...@gmail.com
Have a good day.
Vijay
On Thu, Mar 11, 2021 at 3:53 AM Rajesh Ranjan_067 <
rajeshrausan3...@gmail.com> wrote:
> Dear sakshi mam may I join you, as you are doing on chat app
>
> On Thu, 11 Mar, 2021, 12:15 am sakshi jain, wrote:
>
>>
Hi Kasper,
Sure I am not offended and thank you for asking that. I will be glad to
share the project once completed.
Regards
Vijay
On Thu, 11 Mar, 2021, 08:23 Kasper Laudrup, wrote:
> On 11/03/2021 03.34, vijay naudiyal wrote:
> >
> > Pls no personal attacks. Lets keep the th
Environment: Request Method: POST Request URL:
http://127.0.0.1:8000/accounts/password/reset/ Django Version: 3.1.1 Python
Version: 3.6.6 Installed Applications: ['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.sessions',
'django.contrib.messages',
Remove the quotes
On Mon, Aug 5, 2019 at 11:24 AM Mudasir Mian
wrote:
> Dear Team,
> im facing this error in models
> help me please
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emai
How to create user registration forms
--
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 view this discussion on the w
401 - 446 of 446 matches
Mail list logo