Re: Chinese humanize number conversion

2016-05-03 Thread Simon Charette
Hi Malte, The conversion takes place in the intword template filter[1]. The Chinese translation of the intword_converters can be found in the locale directory of the humanize application[2]. These translations are handled over Transifex[3]. Cheers, Simon [1] https://github.com/django/django

Re: Customised handling for wrong passwords entered in Login page in Django.

2016-05-03 Thread Simon Charette
Hi Arun, If you only want to log failed login attempts I suggest you connect a receiver to the user_login_failed signal[1] instead. Cheers, Simon [1] https://docs.djangoproject.com/en/1.9/ref/contrib/auth/#django.contrib.auth.signals.user_login_failed Le mardi 3 mai 2016 06:01:59 UTC-4, Arun

Re: How to atomically create and lock an object?

2016-05-11 Thread Simon Charette
revent other threads from blocking you might want to use the `nowait` option of select_for_update() and catch the `OperationalError` that might be raised in order to return something else. Cheers, Simon [1] https://docs.djangoproject.com/en/1.9/ref/models/querysets/#get-or-create [2] https://docs.

Re: How to atomically create and lock an object?

2016-05-12 Thread Simon Charette
already started by the demonstrate_the_problem() atomic wrapper. Else the connection is left in an unusable state by the integrity error. Cheers, Simon Le jeudi 12 mai 2016 10:48:30 UTC-4, Carsten Fuchs a écrit : > > Hi Simon, > > many thanks for your reply! > Please see below fo

Re: Getting unexpected results when using multiple aggregates

2016-05-13 Thread Simon Charette
This is a know limitation. Please see "Combining multiple aggregations"[1] in the documentation. Cheers, Simon [1] https://docs.djangoproject.com/en/1.9/topics/db/aggregation/#combining-multiple-aggregations Le vendredi 13 mai 2016 14:56:05 UTC-4, da...@joustco.com a écrit : > &

Re: How made worked models.Sum() together with models.Count in Django annotations?

2016-05-15 Thread Simon Charette
Hi Seti, As documented this will yield the wrong results in most cases until subqueries are used instead of JOINs[1]. Cheers, Simon [1] https://docs.djangoproject.com/en/1.9/topics/db/aggregation/#combining-multiple-aggregations Le dimanche 15 mai 2016 12:42:44 UTC-4, Seti Volkylany a écrit

Re: Working with HstoreField in django tests

2016-05-15 Thread Simon Charette
Hi Denis, >From the exception it looks like the issue is not related to a missing extension but from an attempt of using and integer as a key. e.g. instance.hstore_field = {1: 'foo'} instead of instance.hstore_field = {'1': 'foo'} Cheers, Simon Le dimanche

Re: timezone application aware

2016-05-17 Thread Simon Charette
required fields and middlewares to handle all of this. Cheers, Simon [1] https://docs.djangoproject.com/en/1.9/ref/contrib/gis/geoip/ [2] https://github.com/charettes/django-sundial Le mardi 17 mai 2016 16:51:24 UTC-4, Noumia Ngangoum a écrit : > > > Hi, how really work timezoned applic

Re: Aggregation / annotation over results of a subquery

2016-05-20 Thread Simon Charette
, then='messages' )), ) ).filter( message_count__gte=1, ).order_by('-message_count') Cheers, Simon [1] https://docs.djangoproject.com/en/1.9/ref/models/conditional-expressions/#conditional-aggregation Le vendredi 20 mai 2016 09:14:10 UTC-4, Malcolm

Re: How to implement a ManyToManyField with a View

2016-05-26 Thread Simon Charette
Hi Bruce, I think you want to call get_object_or_404 with the Contact model in your contact_detail() view. Cheers, Simon Le jeudi 26 mai 2016 13:43:00 UTC-4, Bruce Whealton a écrit : > > Hello all, > I started a similar thread but couldn't find it. > I was creating a Per

Re: How to set default ordering to Lower case?

2016-06-06 Thread Simon Charette
name_lower=Lower('name'), ).order_by('name_lower') class Person(models.Model): name = models.CharField(_('name'), max_length=100) objects = PersonManager() Cheers, Simon [1] https://code.djangoproject.com/ticket/26257 [2] https://code.djangoproject.com/tic

Re: Possible bug with UploadedFile and form validation?

2016-06-13 Thread Simon Charette
call it in all cases, even when throwing the `ValidationError`. Cheers, Simon [1] https://docs.python.org/3/library/io.html?highlight=textiowrapper#io.BufferedIOBase.detach Le lundi 13 juin 2016 10:52:36 UTC-4, Nick Sarbicki a écrit : > > I've got an odd bug in my system, and while I

Re: Date() in Django query

2016-06-14 Thread Simon Charette
y use a Func expression[2]: MyModel.objects.annotate(join_date=Func(F('join_time'), function='DATE')).values_list('join_date', flat=True) Cheers, Simon [1] https://docs.djangoproject.com/en/1.10/ref/models/database-functions/#django.db.models.functions.datetime.TruncDate [2] https

Re: Date() in Django query

2016-06-15 Thread Simon Charette
annotate( # values before annotate() specifies the GROUP BY count=Count('uniquecallid', distinct=True) ) Cheers, Simon [1] https://docs.djangoproject.com/en/1.9/topics/db/aggregation/#values Le mercredi 15 juin 2016 07:58:55 UTC-4, Galil a écrit : > > Thank you Simon, >

Re: Prefetch Related with Multiple Column Join

2016-06-18 Thread Simon Charette
27;PublisherMediumBilling', from_fields=['publisher', 'medium'], to_fields=['publisher', 'medium'] ) publisher.articles.select_related('billing') Cheers, Simon Le samedi 18 juin 2016 07:09:03 UTC-4, Ram Jayaraman a écrit : > > I apolo

Re: Prefetch Related with Multiple Column Join

2016-06-18 Thread Simon Charette
Hi Ram, As PublisherMediumBilling.publisher and medium are unique together it's safe to silence the `fields.E310` check failure in this case. By the way the check was adjusted in Django 1.10 to also take `unique_together` into account[1]. Cheers, Simon [1] https://github.com/django/d

Re: Prefetch Related with Multiple Column Join

2016-06-19 Thread Simon Charette
Hi Ram, I suggest you open a new feature request to document ForeignObject as a public API. Cheers, Simon Le dimanche 19 juin 2016 02:26:29 UTC-4, Ram Jayaraman a écrit : > > Hi Simon, > > Thanks a lot for the response again! I really appreciate your time. I saw > the uniq_toge

Re: I need an expert Postgresql.

2016-06-19 Thread Simon Charette
x27;scoppe', models.TextField)) Cheers, Simon [1] https://docs.djangoproject.com/en/1.10/ref/models/database-functions/ Le dimanche 19 juin 2016 08:27:50 UTC-4, Seti Volkylany a écrit : > > > I am try to conver from numberic to string a result of annotated field > (created by a annotati

Re: IntegrityError for unique_together ?

2016-06-23 Thread Simon Charette
urity issues. Cheers, Simon [1] https://code.djangoproject.com/ticket/25987 Le jeudi 23 juin 2016 14:44:10 UTC-4, Derek a écrit : > > Hi > > I have a strange situation (with Django 1.6.11 and MySQL 5.5). Attempting > to save a new entry (from the admin) with values that violat

Re: Django 1.8.13 saving new user gets error NOT NULL constraint failed: auth_user.last_login

2016-07-21 Thread Simon Charette
If you upgraded from Django 1.7 you should make sure to run all auth migrations. If you're using a custom user model make sure to makemigrations for its app and proceed to migrate it. Simon Le jeudi 21 juillet 2016 11:46:37 UTC-4, bobhaugen a écrit : > > NOT NULL constr

Re: Loading fixtures inside a transaction

2016-08-03 Thread Simon Charette
I believe it already does[1] as it is a requirement to support forward references. Cheers, Simon [1] https://github.com/django/django/blob/5c63b3e5a797102d915e1683971517f747a28013/django/core/management/commands/loaddata.py#L68-L69 Le mercredi 3 août 2016 15:42:23 UTC-4, th...@copperleaf.com

Re: Subtracting UNIX_TIMESTAMPS broke in Django 1.10

2016-08-17 Thread Simon Charette
been declared with an `output_field` of `models.IntegerField()` instead. Let me know if that doesn't make sense to you. Cheers, Simon [1] https://github.com/django/django/blob/19e20a2a3f763388bba9263d56db34012e90cf5b/django/db/models/expressions.py#L265-L270 P.-S. You should replace your `.extra()` u

Re: Django query not returning all objects

2016-08-19 Thread Simon Charette
For reference there's a Django ticket to suggest using this technique. Cheers, Simon [1] https://code.djangoproject.com/ticket/19842 Le jeudi 18 août 2016 02:20:34 UTC-4, Todor Velichkov a écrit : > > Another solution would be to annotate min/max deadline date and order by >

Re: Django-drip not working

2016-08-20 Thread Simon Charette
It looks like django-drip has not been ported to Django 1.8 yet. Le samedi 20 août 2016 09:41:06 UTC-4, M Hashmi a écrit : > > Now I am getting another error: > > Traceback: > > File > "C:\Users\Mudassar\dressikarepo\lib\site-packages\django\core\handlers\base.py" > > in get_response > > 132.

Re: Creation of default site not triggering post_save signal

2016-09-10 Thread Simon Charette
sites' for migration, _ in plan): # ... perform actions Let me know if you need more details, Simon Le samedi 10 septembre 2016 21:59:56 UTC-4, Matt Thompson a écrit : > > Hi All, > > I have a small Django app that uses the sites framework and has a > post_save sign

Re: Creation of default site not triggering post_save signal

2016-09-13 Thread Simon Charette
> method of your application configuration class. If you’re using the receiver() > decorator, simply import the signals submodule inside ready(). Cheers, Simon [1] https://docs.djangoproject.com/en/1.10/topics/signals/#connecting-receiver-functions Le lundi 12 septembre 2016 22:59:34 UTC-4, M

Re: django.db.utils.OperationalError when remove the parent model

2016-09-13 Thread Simon Charette
Hi Cheng-Hung, This is know bug[1] Simon [1] https://code.djangoproject.com/ticket/24424 Le mardi 13 septembre 2016 22:02:54 UTC-4, Cheng-Hung Hsueh a écrit : > > The sample project: > https://github.com/sih4sing5hong5/django_migration_error > -- You received this message bec

Re: Django 1.10.3 with Oracle database and --keepdb

2016-11-05 Thread Simon Charette
Hi Carsten, > In other words, without setting an explicit (non-random) password, database > errors are expected when starting the tests with --keepdb ? You are right. I just created a ticket[0] about preventing usage of `--keepdb` without defining a `TEST.PASSWORD` setting. Simon [0]

Re: Related name with %(app_label)s being an actual field?

2016-11-05 Thread Simon Charette
ts to related_name if it's not explicitly defined. Simon Le vendredi 4 novembre 2016 12:40:00 UTC-4, Jonty Needham a écrit : > > Hi, > > In an attempt to fix my earlier query about related names etc, it would > appear that I've (half() fixed my issue. > > I now have:

Re: django.db.utils.OperationalError: near ")": syntax error ERROR at $ python3 manage.py migrate

2016-11-14 Thread Simon Charette
Hello Peter, That looks like https://code.djangoproject.com/ticket/24424 Simon Le lundi 14 novembre 2016 12:06:41 UTC-5, Peter Sels a écrit : > > Dear Django-ers, > > I ran into a problem with Django. > > -- > Situation: > -- > > I am using version 1.10.3 of Dj

Re: DatabaseWrapper.needs_rollback and transaction.rollback()

2016-11-14 Thread Simon Charette
Hello Mark, Is there a reason for not using the transaction.atomic context manager instead of managing your transaction manually by calling .set_autocommit(False) and rollback? Simon Le lundi 14 novembre 2016 15:46:38 UTC-5, mark...@gmail.com a écrit : > > After a validationError occur

Re: Preparing for 2.2LTS - testing for Deprecation Warnings

2019-01-17 Thread Simon Charette
You can use the category kwarg of filterwarnings[0] to pass the Django deprecation warning classes. They can be found in the django.utils.deprecation module. (e.g. RemovedInDjango30Warning). Cheers, Simon [0] https://docs.python.org/3/library/warnings.html?highlight=filterwarnings

Re: django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet with Django’s user database authentication from Apache

2019-01-28 Thread Simon Charette
Hello there, That looks like a Django bug to me as auth.get_user_model() should only be performed from within the check_password() function as it will certainly crash at the module level. You should file a bug report so it gets addressed[0]. Best, Simon [0] https://code.djangoproject.com

Re: django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet with Django’s user database authentication from Apache

2019-01-28 Thread Simon Charette
get_user_model() in django.contrib.auth.handlers.modwsgi. Best, Simon Le lundi 28 janvier 2019 10:16:30 UTC-5, Simon Charette a écrit : > > Hello there, > > That looks like a Django bug to me as auth.get_user_model() should only be > performed > from within the check_password() functio

Re: Limiting a SubQuery based on instance's OuterRef

2019-01-29 Thread Simon Charette
Hello Nick, It isn't possible to reference columns in a LIMIT clause AFAIK. I'd suggest you use a RowNumber[0] window function ordered by your number column in a subquery and filter on the annotated value in the outer query. Cheers, Simon [0] https://docs.djangoproject.com/en/2.1/

Re: Local variable dump on exception in production environment (DEBUG=False)

2019-02-01 Thread Simon Charette
eport similar to when DEBUG=True is enabled in development environment. Cheers, Simon [0] https://github.com/Qix-/better-exceptions [1] https://docs.djangoproject.com/en/2.1/topics/logging/#django.utils.log.AdminEmailHandler Le vendredi 1 février 2019 05:11:47 UTC-5, Web Architect a écrit : &

Password Policy Adherence. Cannot use the passwords used before

2019-02-07 Thread Simon A
rent version of django. I was wondering if there is a way that I can implement this requirement from scratch so I can get the whole picture. If you could, kindly share some references that I can use to start with this.Or at least point me to the topics that I need to look into. Thank you, Simon -

Re: Password Policy Adherence. Cannot use the passwords used before

2019-02-09 Thread Simon A
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/7d7e9de09028498e8fca89973db6484f%40iss2.ISS.LOCAL > <https://groups.google.com/d/msgid/django-users/7d7e9de090284

Re: Password Policy Adherence. Cannot use the passwords used before

2019-02-10 Thread Simon A
7;m not trying to be spoon fed here but just a bit lost. Any feedback would be appreciated. Thank you, Simon On Sunday, February 10, 2019 at 6:28:10 AM UTC+8, Simon A wrote: > > @Jason, yes I believe I do need to research further when that action > happens. the point where the password is

Re: Password Policy Adherence. Cannot use the passwords used before

2019-02-10 Thread Simon A
things to better understand how some magis work. Kind Regards, Simon Arriola On Monday, February 11, 2019 at 9:00:57 AM UTC+8, Jason wrote: > > ClassyCBV doesn't contain everything in django, so that is probably > related to your confusion. > > In classycbv PasswordChangeView&#

Re: Password Policy Adherence. Cannot use the passwords used before

2019-02-11 Thread Simon A
Yes that's very true. I guess I acquired a phobia for diving into the source code because of my first programming language (J**A) because it felt like I was reading cryptic stuff. But not with Python. On Monday, February 11, 2019 at 9:08:35 PM UTC+8, Jason wrote: > > Sometimes going through the

Re: Django update field in many to many relationship

2019-02-14 Thread Simon Charette
Your DirectorForm model form doesn't include 'Leave_current_balance' in it's Meta.fields hence no form field is generated for it. Cheers, Simon Le jeudi 14 février 2019 17:50:21 UTC-5, suabiut a écrit : > > Hi, > > I have two models many to many relationships, I

Re: Is there a package for user-tagging and user-properties?

2019-02-14 Thread Simon A
This might not be a package but django allows to extend the User object via a one to one relationship. Once extended, you can add as many fields as you like. It will be better though if this will happen at the start of the project. Using this method at the middle of the project might cause a lot

Re: select_for_update Documentation is confusing(?)

2019-02-15 Thread Simon Charette
I meant, and *not* "Building a queryset" in my previous reply. Le vendredi 15 février 2019 14:18:27 UTC-5, Simon Charette a écrit : > > Hello Philoj, > > > Does this mean that the above code example will raise > TransactionManagementError... > > It won&#x

Re: select_for_update Documentation is confusing(?)

2019-02-15 Thread Simon Charette
lly only executed when entries are iterated over. Given the documentation clearly mentions "*Evaluating* a queryset" and "Building a queryset" I don't think it's worth amending it. Cheers, Simon Le vendredi 15 février 2019 07:40:51 UTC-5, Philoj Johny

Re: Working with pk arguments within an included URL

2019-02-17 Thread Simon A
I think I had a similar scenario a few weeks ago. One option that you have is to store the originally selected PK to the session object. Whenever you load a page, for you can retrieve the PK from the session object. Most likely you'll do this on the get_queryset function On Sunday, February 17,

Re: REG: Why my django email settings not sending email notifications?

2019-02-17 Thread Simon A
Just to add, please try to create a python file with the simplest implementation of send mail just to check if it actually works. On Monday, February 18, 2019 at 11:43:22 AM UTC+8, Sid wrote: > > can you check if you your email server is somehow blocking your emails? > Have you enabled your deb

Re: Working with pk arguments within an included URL

2019-02-18 Thread Simon A
] = 'value' # get a session variable self.request.session.get('key', None) On Mon, Feb 18, 2019 at 3:10 PM Gavin Boyle wrote: > Hi Simon, > > That’s a great idea, I’ve only ever worked with built in sessions for > logging in. Would you have a link to some documentation

Re: Help with aggregates needed

2019-02-27 Thread Simon Charette
OIN element ON ( expenses.element_id = element.id ) WHERE expenses.year = $year GROUP BY area.name, element.name ORDER BY area.name, element.name Cheers, Simon Le mercredi 27 février 2019 14:04:21 UTC-5, Felix Lazaro Carbonell a écrit : > > Hi to everyone: > > > > H

Re: Why are foreign keys rewritten when adding related_name?

2019-03-01 Thread Simon Charette
Hello HM, I know that some changes have been made to avoid unnecessary foreign key rebuilds on some option changes. Are you experiencing this on 2.1 and 2.2 pre release? Simon Le vendredi 1 mars 2019 02:40:01 UTC-5, HM a écrit : > > I added "related_name" to an exiting Foreig

Re: Django 2.1.4: Permissions are not updated after migrations

2019-03-17 Thread Simon Charette
Hello Yevgeny, I don't have magic solution to suggest to you given the current state of your permission data after a few iterations but I just wanted to let you know that it's a known issue[0] and a contributor is actively working on getting it fixed[1]. Cheers, Simon

Re: Django 2.1.4: Permissions are not updated after migrations

2019-03-17 Thread Simon Charette
Hello Yevgeny, I'd start by deleting your stale content types[0] which your permissions are attached to. That should deal with deleted model case. For the renames I suggest you drop into a shell and manually edit the Permission.name of the misnamed instances. Best, Simon [0]

Re: Django 2.1.4: Permissions are not updated after migrations

2019-03-18 Thread Simon Charette
point to a model? They point to models through the Permission.content_type foreign key; ContentType have an (app_label, model_name) unique tuple. Best, Simon Le lundi 18 mars 2019 04:35:55 UTC-4, Yevgeny Bar Lev a écrit : > > Thanks Simon! > Two questions: > a) Would the following st

Re: Creating Objects from Annotations and Other Models

2019-03-21 Thread Simon Charette
supporting RETURNING but it was still missing consensus about what to do on other backends. If I remember correctly the two alternatives were to defer the field or perform an immediate SELECT. Cheers, Simon Le jeudi 21 mars 2019 13:06:04 UTC-4, Dylan Young a écrit : > > For ex

Re: Create models using raw SQL queries

2019-03-27 Thread Simon A
hi Cameron, as Eric said, by doing this you might not fully take advantage of the features of django. But if you still want to proceed maybe you can use the managed option for models. https://docs.djangoproject.com/en/2.1/ref/models/options/#managed. with this approach, you'll create the databa

Re: Unit-Testing Django Views

2019-03-28 Thread Simon Charette
th or without html=True) and assertTemplateUsed[2] instead. Cheers, Simon [0] https://docs.djangoproject.com/en/2.1/ref/csrf/#how-it-works [1] https://docs.djangoproject.com/en/2.1/topics/testing/tools/#django.test.SimpleTestCase.assertContains [2] https://docs.djangoproject.com/en/2.1/topics/te

How to deploy migrations to production

2019-04-02 Thread Simon A
There is a workflow section in the migration page from the django project documentation. But there are somethings I am confused about, It says that the migrations need to be created in the non production environment and then checked in to the repository along with the changes in models.py. My

Re: How to deploy migrations to production

2019-04-02 Thread Simon A
Ah I see. Thank you Jani for clearing that up. -- 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,

Re: How to deploy migrations to production

2019-04-02 Thread Simon A
server. > > Take a look at > https://github.com/speedy-net/speedy-net/blob/master/contrib/deploy.sh > אורי > u...@speedy.net > > > On Tue, Apr 2, 2019 at 3:51 PM Simon A > > wrote: > >> There is a workflow section in the migration page from the django pr

Re: UniqueConstraint raises uncaught IntegrityError in Admin

2019-04-09 Thread Simon Charette
dation yourself until built-in support is added. Submitting a new Trac ticket so we don't loose track of the issue would also be appreciated. Cheers, Simon [0] https://github.com/django/django/pull/10796#discussion_r244216763 Le mardi 9 avril 2019 07:29:53 UTC-4, Ryan Jarvis a écrit : > >

Re: Django 2.2 and custom media in the admin

2019-04-09 Thread Simon Charette
form media assets. [1] Cheers, Simon [0] https://docs.djangoproject.com/en/2.2/releases/2.2/#merging-of-form-media-assets [1] https://docs.djangoproject.com/en/2.2/topics/forms/media/#assets-as-a-static-definition Le mardi 9 avril 2019 11:02:35 UTC-4, Thorsten Sanders a écrit : > > Hello, >

Merging multiple Django project into one

2019-04-18 Thread Simon Liu
Hello, I am try to migrate users from an old project into a a new project i am working on. I have extracted all the models from my old project into a reusable app. I was able to connect to multiple database, but i wasn't able to make my project be able to read the users and group from my old p

Re: Pagination breaks in ListView after migrating from Django 1.11 to 2.2 with SQLite

2019-04-23 Thread Simon Charette
I assume you are either using a Subquery annotation that returns multiple results or an __in lookup against a query with multiple columns. I vaguely remember something changed in this area but it was documented in one of the 2.0, 2.1 or 2.2 release notes. Best, Simon Le mardi 23 avril 2019 10

Re: Django 2.2 creates multiple migration files when AbstractUser is used

2019-05-02 Thread Simon Charette
Hey David, Could you try explicitly defining an objects manager on your User model and see it if helps. e.g. from django.contrib.auth.models import UserManager class User(AbstractUser): ... # fields objects = UserManager() I'm also having trouble reproducing locally though.

Re: Dealing with global or session objects

2019-05-23 Thread Simon A
# get operation request.session.get('key', None) # set operation self.request.session['key'] = value Please also see https://docs.djangoproject.com/en/2.2/topics/http/sessions/ for more information. Regards, Simon. On Wednesday, May 22, 2019 at 9:26:15 PM UTC+8, Jean-Noël Coli

Re: some random problem

2019-05-23 Thread Simon A
share the code here. I know django devs are lazy but don't be this lazy. On Wednesday, May 22, 2019 at 8:07:08 PM UTC+8, Soumen Khatua wrote: > > Hi Folks, > > I'm getting len(cart) is 0 and after iterate *item is not coming from > cart* in this project,plese tell me where is my problem. > I'm sh

Re: Filtering Data Based On Foreign Key

2019-05-23 Thread Simon A
Have you tried putting the load_price() code inside the init code? like def __init__(self, *args, **kwargs): super(PlayerRegistrationForm, self).__init__(*args, **kwargs) self.fields['club_id'].widget = forms.HiddenInput() membership = request.GET.get('membership_title')

Formtools Wizard and Modelform saving data

2019-05-28 Thread Simon John
I am trying to save data to db after all the three from have submited and still getting and error, any work around -- 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

SAVING DATA IN FORMTOOL WIZARD MODELFORM

2019-05-28 Thread Simon John
Hi Any one can help on how to save data using formtool wizard and Modelform The view of my models and form and views and the error are here -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emai

Re: Django tests appear to be getting substantially slower

2019-06-15 Thread Simon Charette
Hi Mark, It's hard to tell exactly what's going on without more details but assuming you are running tests against SQLite the 2.1 to 2.2 slowdown is likely caused by the fact database constraints are now checked of each TestCase[0]. Cheers, Simon [0] https://docs.djangoproject.

Re: Django tests appear to be getting substantially slower

2019-06-15 Thread Simon Charette
I meant Django 2.0 -> 2.1. As long as you are using Django 2.2 with SQLite 3.20+ the slowdown I mentioned should be effective. Simon Le samedi 15 juin 2019 08:32:56 UTC-4, Mark Jones a écrit : > > Maybe that's the case, I didn't build the python2.7 or 3.7, but I used >

Re: Django tests appear to be getting substantially slower

2019-06-16 Thread Simon Charette
own: 1. A slower Django setup(), I think some changes were part of 1.8 -> 1.11 2. Reliance on now lazily loaded part of Django. Cheers, Simon [0] https://docs.python.org/3/library/profile.html Le samedi 15 juin 2019 11:25:10 UTC-4, Mark Jones a écrit : > > Ah, but the slowdown is happeni

Re: Package that helps update only changed fields

2019-06-18 Thread Simon Charette
ate_fields = None def save(self, commit=True): instance = super().save(commit=False) if commit: update_fields = None if instance._state.adding else self.update_fields instance.save(update_fields=self.update_fields) return instance Cheers, Simon L

Re: IndexError: Number of args exceeds number of fields

2019-06-19 Thread Simon Charette
It's hard to tell without the full traceback but Django 1.11 doesn't support Python 3.7 so it'd start by either using Django 2.2 or downgrading to Python 3.6 Cheers, Simon Le mercredi 19 juin 2019 08:16:51 UTC-4, Ezequias Rocha a écrit : > > Hi everyone > > I am doin

Re: Vicious cycle: Cannot migrate a DB that uses a widget using a model

2019-06-19 Thread Simon Charette
sure the Country.objects.order_by('name') query is only executed when .widgets is accessed for the first time on a PlaceWidget instance instead of at initialization time. Cheers, Simon [0] https://docs.djangoproject.com/en/2.2/topics/performance/#cached-property Le mercredi 19 juin 201

Job board app based in django

2019-06-21 Thread Simon A
hey guys, I would like to develop a job board app based in django. I was wondering if there is already an available job board app based in django like jobberbase. There is a jobberbase clone made from django but its version too old already. thank you, Simon -- You received this message

Re: [Urgent] 500 when requesting a file from browser.

2019-06-21 Thread Simon A
On the last part of your stacktrace, there is a section File "/usr/lib/python3.6/wsgiref/simple_server.py", line 35, in close self.status.split(' ',1)[0], self.bytes_sent could you please check this line out? you can try to print what is *self.status *to check what it is trying to split

Re: How to store a bank account number generated into a model field

2019-06-21 Thread Simon A
I think the except block won't trigger since if the code Profile.objects.get(user=request.user) does not get any results, it will return a null result, not throw exception. instead of exception handling, just check if the return value is null or not -- You received this message because you are

Re: Job board app based in django

2019-06-21 Thread Simon A
Oh really? Yeah I guess it wont be too bad if I create one. On Fri, Jun 21, 2019 at 6:56 PM Omar Abou Mrad wrote: > There are problem N clones of job boards built with django, this shouldn't > affect your decision to create one. > > On Fri, Jun 21, 2019 at 10:59 AM Simon A wro

Re: From SQL to Django Queryset API

2017-03-29 Thread Simon Charette
Hello Mauro, The following should do from django.db.models import F Movimento.objects.values( 'anno','impianto' ).annotate( dare=Sum('dare), avere=Sum('avere), diff=Sum(F('dare') - F('avere)), ) Cheers, Simon Le mercredi 29 ma

Re: Executing DB-Queries during import

2017-03-29 Thread Simon Charette
) that performs queries at resolve()/reverse() time instead. A simpler solution could be to define a catch all view like django-cms does and perform the routing inside the view. Cheers, Simon Le mercredi 29 mars 2017 08:39:52 UTC-4, guettli a écrit : > > > > Am Mittwoch, 22. März 2017 19:2

Re: TransactionManagementError from inside atomic block

2017-03-29 Thread Simon Charette
tomic() block using the same database involved in the select_for_update() call? e.g. Are you using transaction.atomic() (which will use the default database) but have database routers that could route reads/writes to another db? Cheers, Simon Le samedi 25 mars 2017 15:08:19 UTC-4, Ketan Bhatt a

Re: Annotated queryset + Prefetch object

2017-04-08 Thread Simon Charette
Hello Jose, I wouldn't be surprised if this was caused by a Django bug with prefetches doing weird things when the same model is referenced through different relations[0]. Simon [0] https://code.djangoproject.com/ticket/26318 Le samedi 4 mars 2017 13:36:20 UTC-5, Jose Kilo a écrit : &

Re: JsonField icontains filter generates invalid SQL

2017-04-10 Thread Simon Charette
Hello there, I'm not sure where you determined the SQL that caused the error but I'm pretty sure this was caused by "my_model"."data" -> 'name' not being wrapped in a parenthesis before the ::text cast. This has been fixed in Django 1.11[0]. Cheers, S

Re: Project layout

2017-04-15 Thread Simon McConnell
I came across this in my reading. I'm only just starting to learn django so don't know the reason it does it. As I understand it the first clientmgmtsystem is actually clientmgmtsystem_proje

Re: There seems an issue in Django(1.11)'s password displaying form in admin site.

2017-04-19 Thread Simon Charette
Hey there, It looks like it has been fixed already[0] and will be part of the upcoming 1.11.1 release. Cheers, Simon [0] https://github.com/django/django/commit/dff559ff83a6aac14de0bbca58101786edf4195f Le mercredi 19 avril 2017 17:31:47 UTC-4, Xdynix a écrit : > > Hello everyone. >

Re: Configurar Supervisor + Gunicorn + Nginx

2017-05-02 Thread Simon McConnell
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04 On Tuesday, 2 May 2017 20:34:31 UTC+10, Ariel Gavegno wrote: > > Buenas, necesito saber como configurar Supervisor en un servidor Ubuntu, > de un proyecto Django 1.11. > Un

Define port for LiveServerTestCase in 1.11?

2017-05-06 Thread Simon McConnell
Hi, Is it possible to define the port for LiveServerTestCase in Django 1.11? Google requires a static address for OAuth authentication. from docs : Changed in Django 1.11: In older versions, Django tried a pre

Define port for LiveServerTestCase in 1.11?

2017-05-06 Thread Simon McConnell
Hi, Is it possible to define the port for LiveServerTestCase in Django 1.11? Google requires a static address for OAuth authentication. from docs : *Changed in Django 1.11:* In older versions, Dja

Re: Define port for LiveServerTestCase in 1.11?

2017-05-07 Thread Simon McConnell
iscussion > > On Sunday, May 7, 2017 at 12:18:06 AM UTC-4, Simon McConnell wrote: >> >> Hi, >> >> >> >> Is it possible to define the port for LiveServerTestCase in Django 1.11? >> Google requires a static address for OAuth authentication. >> &

Re: Localization with thousand separator makes foreign key id invalid in forms

2017-05-11 Thread Simon Charette
Hello Thomas, Probably caused by #28075 [0], fixed in 1.11.1. Cheers, Simon [0] https://code.djangoproject.com/ticket/28075 Le jeudi 11 mai 2017 11:39:41 UTC-4, Alti a écrit : > > Hello, > > With localization and thousand separator active, my foreign keys ids are > rendered

Re: Subquery filter (__in) causing invalid SQL

2017-05-12 Thread Simon Charette
Hi Murray, That looks like a bug to me. Do you get similar results if you don't use the Subquery expression and pass the query directly instead? Something along the lines of Permit.objects.filter(~Q(uuid__in=activeSuspensionPermitUuidsQuery.values('permit__uuid')) Simon Le

Re: Model representation with FK, exceeding queries

2017-05-12 Thread Simon Charette
#x27;s possible that the template based widget rendering introduced in 1.11 broke your optimization somehow that would be an actual bug. Simon Le vendredi 12 mai 2017 13:03:23 UTC-4, Cleiton Lima a écrit : > > I do not know if it is a bug or has already been commented > > # models.py

Re: Subquery filter (__in) causing invalid SQL

2017-05-12 Thread Simon Charette
Murray, Glad I could help! I recently contributed changes to this part of the ORM hence why it rang a bell when I saw your issue. Subquery was introduced in 1.11 so it's still a new feature that hasn't been battle tested yet. Please file a new ticket on Trac [0]. Cheers, Simon

Re: Subquery - Expression | Django 1.11.1

2017-05-16 Thread Simon Charette
re details. Cheers, Simon [0] https://code.djangoproject.com/ticket/28199 Le mardi 16 mai 2017 11:02:37 UTC-4, Алексей Широков a écrit : > > Guys help me figure it out. > > I use an example from the documentation > > https://docs.djangoproject.com/en/1.11/ref/models/expressions/#lim

Re: Annotate an object with the value of a filtered, related object's attribute

2017-05-21 Thread Simon Charette
=Subquery(children.filter(gender='M')[:1]), oldest_daughter_dob=Subquery(children.filter(gender='F')[:1]), ) Note that I haven't tried the above code myself so it might required adjustments. Cheers, Simon [0] https://docs.djangoproject.com/en/1.11/ref/models/expressions/#subquery-express

Re: Annotate an object with the value of a filtered, related object's attribute

2017-05-21 Thread Simon Charette
T 1) AS oldest_daughter_dob FROM adult; Cheers, Simon Le dimanche 21 mai 2017 11:08:37 UTC-4, Yo'av Moshe a écrit : > > Thanks, never heard of Subqueries before! It's time to upgrade to Django > 1.11 I guess. > > Performance-wise, do you know if it's any different

Re: Updating 1.10 to 1.11.1 and AttributeError

2017-05-23 Thread Simon Charette
Hello, Could you please share all of your INSTALLED_APPS? Are you using any kind of query caching? Thanks, Simon Le mardi 23 mai 2017 08:52:56 UTC-4, Jorge Cadena a écrit : > > Hi > > using: django.db.backends.postgresql_psycopg2 > > DATABASE_ROUTERS = ['app.general.ro

Re: Trouble upgrading ModelField class for django 1.10

2017-06-03 Thread Simon Charette
ncoder (or DjangoJSONEncoder) subclass. class ToStrJSONEncoder(DjangoJSONEncoder): def default(o): if hasattr(o, 'to_str'): return o.to_str() return super().default(o) Cheers, Simon [0] https://docs.djangoproject.com/en/1.8/releases/1.8/#subfieldbase Le samedi 3 juin

Re: Combining querysets while maintaining desired ordering?

2017-06-03 Thread Simon Charette
Hello Richard, Since Django 1.11 you should be able to use the QuerySet.union() method[0] for that. queryset = self.many_field1.order_by('some', 'fields') combined = queryset.union(self.many_field2.order_by('some', 'fields')) Best, Simon [0] https://d

<    1   2   3   4   5   6   7   8   >