not thread-safe function can break a django application?

2014-11-22 Thread Fabio C. Barrionuevo da Luz
I was trying to answer a question in a Brazilian forum about django. one of the proposed solutions utilized the function locale.setlocale() from locale module. according to the documentation[1] locale.setlocale() function is not thread-safe the question is: not thread-safe function can break a

create unmanaged model to oracle view/synonym

2014-12-31 Thread Fabio C. Barrionuevo da Luz
Hello, is possible with Django 1.7 create a unmanaged Django model for Oracle database View? I succeeded in doing this using sqlalchemy, However, would like to use Django and Django ORM. -- Fábio C. Barrionuevo da Luz Acadêmico de Sistemas de Informação na Faculdade Católica do Tocantins -

Where exactly in the django source code, the default permissions are created?

2013-12-19 Thread Fabio C. Barrionuevo da Luz
Hello guys, I'm trying to understand the inner workings of the permissions django system. My question is where exactly in the django source code, the default permissions are created? -- Fábio C. Barrionuevo da Luz Acadêmico de Sistemas de Informação na Faculdade Católica do Tocantins - FACTO

Apps for versioning model fields

2015-06-29 Thread Fabio C. Barrionuevo da Luz
Hello, I need to implement versioning of a TextField to an electronic system to manages documents. Before I try to reinvent the wheel, I'd like to know what are the reusable apps are available that solve this problem. I have the following model class:

get all current active connected users

2015-12-09 Thread Fabio C. Barrionuevo da Luz
hello, Django provide any API for get all users who are currently connected? I need to run some scheduled tasks for users who are not connected and did not understand how I can get the users with active login via Session -- Fábio C. Barrionuevo da Luz Palmas - Tocantins - Brasil - América do

Re: Custom date format stopped working in template

2015-12-10 Thread Fabio C. Barrionuevo da Luz
This is a bug that will be fixed in the next bugfix release django (1.8.8) https://docs.djangoproject.com/en/1.9/releases/1.8.8/#bugfixes 2015-12-10 3:26 GMT-03:00 sandino : > Hello, > > I have custom localized data formats ( >

Pessimistic concurrency control

2015-12-16 Thread Fabio C. Barrionuevo da Luz
Hi everyone! anyone know of any other alternative to https://github.com/RobCombs/django-locking , which implements "Pessimistic concurrency control" I need to avoid concurrent editing. while a user keep an open a editing window (UpdateView), I can not let another user edit the same object

[OT] Web application and image scanner

2014-05-28 Thread Fabio C. Barrionuevo da Luz
Anyone know any client-side alternative to Java and Java Applets in a Web application to capture images from Network or USB scanner and send to server somehow (WebDAV, HTTP POST FILE, or other way)? -- Fábio C. Barrionuevo da Luz Acadêmico de Sistemas de Informação na Faculdade Católica do

interesting project: django-crucrudile

2014-06-26 Thread Fabio C. Barrionuevo da Luz
https://github.com/pstch/django-crucrudile -- Fábio C. Barrionuevo da Luz Acadêmico de Sistemas de Informação na Faculdade Católica do Tocantins - FACTO Palmas - Tocantins - Brasil - América do Sul http://pythonclub.com.br/ Blog colaborativo sobre Python e tecnologias Relacionadas, mantido

Behavior of the "update" in Django 1.7

2014-09-22 Thread Fabio C. Barrionuevo da Luz
Hello. Some questions. Walking through projects on github i found django-save-the-change[1] Interesting project. But what django-save-the-change[1] proposes to do is still valid for Django 1.7? I think it would be good practice to only touch in the fields in the database in which there really

django-admin2 into production environment

2014-10-07 Thread Fabio C. Barrionuevo da Luz
hello, I wonder if anyone successfully uses the django-admin2[1] in the production environment If so, what are your thoughts on the pros and cons based on your experience of use. You have a site or blog which records the problems and solutions encountered when using and customize django-admin2

Re: mathematical function and django connect

2016-02-09 Thread Fabio C. Barrionuevo da Luz
https://en.wikipedia.org/wiki/Regular_expression https://docs.djangoproject.com/en/1.9/topics/http/urls/ https://regex101.com/#python On Tue, Feb 9, 2016 at 5:41 PM, Xristos Xristoou wrote: > what is regext? > > Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης

Re: mathematical function and django connect

2016-02-09 Thread Fabio C. Barrionuevo da Luz
these questions will be answered with the knowledge that you acquire after after completing the official tutorial: https://docs.djangoproject.com/en/1.9/intro/ and additionally, perhaps : http://masteringdjango.com/introduction/ or http://www.tangowithdjango.com/book17/ On Tue, Feb 9, 2016

Re: Django Forms vs Angularjs

2016-03-22 Thread Fabio C. Barrionuevo da Luz
self.fields[name].widget.attrs['disabled'] = 'disabled' self.fields[name].widget.attrs['readonly']=True is not make real readonly to field, because if user can edit the html on client side, and remove disabled="disabled" and readonly input atributtes to problem of readonly fields, i currently

run python function in output of annotated query

2016-03-31 Thread Fabio C. Barrionuevo da Luz
Hello django-users, I have a unmanaged model, of legacy database, used only to read. I need to clean the value of a field returned in a annotated query. I try created a new model field inherits from TextField and override to_python method to clean the value (remove all html using

Re: run python function in output of annotated query

2016-03-31 Thread Fabio C. Barrionuevo da Luz
no specific reason. This value is later converted to json, and consumed by javascript from Ajax call.. this was the simplest way I thought, without being obliged to rewrite an one ton of code. ( yes it is a lovely project with spaghetti code, which I hope will one day be authorized to rewrite it

Re: Query and order by time difference of a specified time.

2016-05-23 Thread Fabio C. Barrionuevo da Luz
it would probably be better to use a custom "Func"[1] and a custom "Query Expression" [2] than user QuerySet.extra [1] https://docs.djangoproject.com/en/1.9/ref/models/database-functions [2] https://docs.djangoproject.com/en/1.9/ref/models/expressions/ On Mon, May 23, 2016 at 11:16 AM, Ketan

Re: How to create Xlm file in specific folder ?

2016-08-10 Thread Fabio C. Barrionuevo da Luz
Dear Asad, Ludovic Coues has already answered your question. simply create a new file and save the content in it: from django.template.loader import render_to_string xml_content = render_to_string('my_xml_template_with_django_template_variables.xml', {'foo': 'bar'}) file_path =

Re: Disabling migrations when running tests

2016-07-16 Thread Fabio C. Barrionuevo da Luz
try this library: https://github.com/henriquebastos/django-test-without-migrations/ On Sat, Jul 16, 2016 at 7:20 PM, James Schneider wrote: > >> > >> Could you explain what you mean by running tests? > > > > > > Yes. I'm talking about "manage.py test". > > > > The

Re: Adding custom Template downloaded

2016-08-08 Thread Fabio C. Barrionuevo da Luz
Please, explain step by step, what and how you do to get "template" from github. That said, when I was starting out in the world of information technology, this text gave me several useful tips on how to ask questions in order to have more chances to get a satisfactory answer:

Re: Is this behavior with Meta Ordering and Group By expected?

2016-06-29 Thread Fabio C. Barrionuevo da Luz
Hi Eric. This is the expected behavior ( https://docs.djangoproject.com/en/dev/ref/models/options/#ordering ). If ordering is defined on model Meta, the ORDER BY SQL is included by default in all query. to avoid this behavior, you can use order_by() without parameters: eg:

Re: HTTP2 Server Push with Django?

2016-06-28 Thread Fabio C. Barrionuevo da Luz
as far as I know, there is still no any web server that fully implements the "push" capability from HTTP2 specification. let me know if any web server now implements "push" capability completely On Tue, Jun 28, 2016 at 9:46 AM, Bobby Mozumder wrote: > Does anyone know of

Re: Django Docs not returning search results - 1.10

2016-11-17 Thread Fabio C. Barrionuevo da Luz
kivy-django is not a Django Software Foundation project and i don't know who is creator and owner of this project -- Fábio C. Barrionuevo da Luz Em 17/11/2016 06:23, "Sayth Renshaw" escreveu: > Hi > > Trying to check if this is an odd problem I am expereincing or

Re: Phone number field in form/ model

2016-12-14 Thread Fabio C. Barrionuevo da Luz
Use CharField and try to find on https://django-localflavor.readthedocs.io/en/latest/ a Phone form Field for valid to you country or create Or create your own PhoneFormField with the validation rules that you need Implementation example:

Re: Error with Tutorial - Writing your first Django app, part 1

2016-12-09 Thread Fabio C. Barrionuevo da Luz
Missing comma on you urlpatterns urlpatterns = [ url(r'^polls/', include('polls.urls'))* ,* url(r'^admin/', admin.site.urls), ] On Fri, Dec 9, 2016 at 4:10 PM, shah wrote: > Hi, I am facing the same issue with the tutorial. > > I have got my program

Re: Criar aquivo urls.py

2016-12-19 Thread Fabio C. Barrionuevo da Luz
uai, desde que arquivos python simplesmente são arquivos de texto, abra um editor de texto como o Notepad++, Gedit, SublimeTex e crie o arquivo com o nome urls.py e coloque dentro dele o código relativo as urls... Talvez você deva explicar melhor quais os problemas que você está tendo On Mon,

Re: Chart library for django

2017-03-06 Thread Fabio C. Barrionuevo da Luz
another option: https://github.com/agiliq/django-graphos https://github.com/agiliq/django-graphos#charting-api-supported live sample: http://agiliq.com/demo/graphos/ On Mon, Mar 6, 2017 at 2:15 PM, acheraime . wrote: > In one of my project I've used django-nvd3

Re: add a secretballot middleware to MIDDLEWARE_CLASSES

2017-04-08 Thread Fabio C. Barrionuevo da Luz
Hello Shahab. Perhaps the real problem is that you apparently have not completed a good tutorial to learn how django works and how to use it. I would recommend these two tutorials: https://tutorial.djangogirls.org/ and http://www.marinamele.com/taskbuster-django-tutorial said that, this is the

Fluent interface on custom methods of custom Queryset class

2017-07-19 Thread Fabio C. Barrionuevo da Luz
What is the right way to make Fluent interface on custom methods of custom Queryset class? In other words, how to make "by_validity" work without lost previous filters? Procedure.objects.filter(is_active=False).by_validity() I've tried using q = self or q = self.query before apply

JSONField on Django 1.8

2017-06-27 Thread Fabio C. Barrionuevo da Luz
Hello, does anyone know of any good Django 1.8 compatible backport of Django 1.9 > JSONField? I would like to use JSONField and ORM query lookups, however it still was not allowed by my employer to migrate to the new version of Django. -- Fábio C. Barrionuevo da Luz Palmas - Tocantins - Brasil

Re: Mark as deleted instead of actually deleting in DeleteView

2017-09-21 Thread Fabio C. Barrionuevo da Luz
try use : SoftDeletableModel and SoftDeletableManager of django-model-utils https://django-model-utils.readthedocs.io/en/latest/models.html#softdeletablemodel https://django-model-utils.readthedocs.io/en/latest/managers.html#softdeletablemanager

Re: There is any way to prevent cascade delete on FK field, without using signal?

2017-10-03 Thread Fabio C. Barrionuevo da Luz
explicitly define what to do when there is a deletion. use the "on_delete" parameter of ForeignKey/OneToOneField on django <=1.11, on_delete is optional, and its default value is CASCADE. after django >- 2.0, it is mandatory to set "on_delete"

Re: Deploy on Heroku

2018-06-27 Thread Fabio C. Barrionuevo da Luz
The error is explicitly here: django.core.exceptions.ImproperlyConfigured: sets the REDIS_URL environment variable that is, you have not enabled the Redis plugin in Heroku. As shown in the cookiecutter-django tutorial, it's just you, inside the folder of your project, run: heroku

Re: Django 1.11 and PostgreSQL 10 compatibility

2017-10-26 Thread Fabio C. Barrionuevo da Luz
Psycopg 2.7.3.2 was released with Postgresql 10 support http://initd.org/psycopg/articles/2017/10/24/psycopg-2732-released/ 2017-10-22 3:54 GMT-03:00 Edandweb : > Thanks > > On Thursday, 19 October 2017 12:27:50 UTC+3, Edandweb wrote: >> >> Hi, >> >> I am developing a

Re: Using other schema in PostgeSQL

2018-04-06 Thread Fabio C. Barrionuevo da Luz
This is a very old issue: https://code.djangoproject.com/ticket/6148 https://code.djangoproject.com/ticket/7556 https://code.djangoproject.com/ticket/22673 I do not know if there is someone working on ORM and Migrations to fix this issue. I've seen something like this somewhere, but I do not

how to programmatically get the index name of a model field on a migration of django 1.8

2018-06-29 Thread Fabio C. Barrionuevo da Luz
Hello, I need to delete an index created automatically by Django, from a third-party application and my own django apps, for later I recreate the index optimized way. this django application is used in several companies. so I need to distribute these improvements via django migration. I'm using

Re: Heroku and DJango_Filters

2019-06-26 Thread Fabio C. Barrionuevo da Luz
ter> > <https://www.instagram.com/epiccharterschools/> > <https://www.youtube.com/user/EpicCharterSchools> > > > > > On Wed, Jun 26, 2019 at 2:17 PM Fabio C. Barrionuevo da Luz < > bna...@gmail.com> wrote: > >> Heroku use a "buildpack" >> https

Re: Heroku and DJango_Filters

2019-06-26 Thread Fabio C. Barrionuevo da Luz
Heroku use a "buildpack" https://devcenter.heroku.com/articles/buildpacks to do automate some things in the deployment. you can attach one or more buildpacks to your project in heroku you can also create your own buildpack to customize it. specifically for Python, the heroku python buildpack (

Re: Heroku and DJango_Filters

2019-06-26 Thread Fabio C. Barrionuevo da Luz
Is very hard to help you without the full traceback of the errors. run: heroku logs put the output into https://gist.github.com/ and send the generated link. ps: make sure you remove from the traceback any line related to password, api keys Many years ago, they recommended me to read this

Re: 如何解析源码

2019-07-15 Thread Fabio C. Barrionuevo da Luz
https://github.com/django/django Em seg, 15 de jul de 2019 07:51, xuehao weng escreveu: > 如何解析源码 > > -- > 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-versatileimagefield and Django 3.1/3.2 compatibility

2021-03-29 Thread Fabio C. Barrionuevo da Luz
order to finally figure out a way to fix this. -- Fabio C. Barrionuevo da Luz Palmas - Tocantins - Brazil - South America GMT -3 Timezone https://github.com/luzfcb/ https://twitter.com/luzfcb/ -- You received this message because you are subscribed to the Google Groups "Django users" gro

Re: django

2021-03-29 Thread Fabio C. Barrionuevo da Luz
Your implementation can probably be changed to something like this import random all_qs = Trending.objects.all() if all_qs.exists(): # checks whether to return at least one record # query all pk numbers and convert to a tuple all_pks = tuple(all_qs.values_list("pk", flat=True)) #

Re: Queryset in settings.py?

2022-01-28 Thread Fabio C. Barrionuevo da Luz
emplate.html. How can archive this? > > Thank you very much > > Am Sa., 29. Jan. 2022 um 00:14 Uhr schrieb Fabio C. Barrionuevo da Luz < > bna...@gmail.com>: > >> Hi Sebastian, I guess this is not possible. >> >> But the real question is: why do you need a qu

Re: Queryset in settings.py?

2022-01-28 Thread Fabio C. Barrionuevo da Luz
Hi Sebastian, I guess this is not possible. But the real question is: why do you need a queryset to perform in the settings? Perhaps if you explain what problem you want to solve, we can give you some options for other possible solutions. Em sex., 28 de jan. de 2022 às 20:00,

Re: order_by on the basis of time difference (updated_at - created_at)

2022-01-21 Thread Fabio C. Barrionuevo da Luz
this can be easily solved by using an annotation to calculate the difference and store it in a new temporary column, and then sort by it from django.db.models import F from myapp.models import ExampleModel queryset = ExampleModel.objects.annotate( dt_difference=F('updated_at') -

Re: A picturesque authentication problem ONLY in Google Chrome

2023-06-08 Thread Fabio C. Barrionuevo da Luz
Try to define the SESSION_COOKIE_DOMAIN on your settings.py SESSION_COOKIE_DOMAIN=".dominio.com.br" https://docs.djangoproject.com/en/4.2/ref/settings/#session-cookie-domain https://django.readthedocs.io/en/1.4.X/ref/settings.html#session-cookie-domain That said, Django 1.4.22 was released 8