return or not from super().method(*args, **kwargs)

2021-11-30 Thread Carles Pina i Estany
this happened when I was reading some code and I thought that I was in a "save()" for a form but I was in the model. For the form I need to not forget the "return". Thanks for any thoughts / comments :-) Cheers, -- Carles Pina i Estany https://carles.pina.cat -- Y

how to add an extra field in an admin form (not part of the model)

2020-05-17 Thread Carles Pina i Estany
I mean, all failed in different ways). Does any of you expand an admin form with a new field? any idea, references, etc. welcomed! Thank you very much, -- Carles Pina i Estany -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsub

Re: how to add an extra field in an admin form (not part of the model)

2020-05-17 Thread Carles Pina i Estany
d me for the same problem. > > Raj Patel > > On Sun, 17 May, 2020, 6:50 pm Carles Pina i Estany, wrote: > > > > > Hi, > > > > Last week I tried to do something in admin but it didn't work as I had > > guessed. > > > > The simplificati

not possible to delete if calling self.errors in a Form in InlineFormSet

2020-06-18 Thread Carles Pina i Estany
the number that I need and I apply the same logic as the "clean" to decide if I need to show the checkbox or not. I wonder if there is some other way to approach this issue that is a bit cleaner (avoiding self.data, self contained in the form logic, etc.). Do you use any other approach?

Re: project ideas

2020-07-31 Thread Carles Pina i Estany
Do you have lots of books? A book locator... etc. :-) -- Carles Pina i Estany https://carles.pina.cat -- 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

Re: I want to store (City, Country) pairs in my models as a field. Is GeoDjango an overkill for my use case?

2020-09-17 Thread Carles Pina i Estany
; to use?* I've read your question in multiple places I think! I would seriously consider just using: https://django-autocomplete-light.readthedocs.io/en/master/ You would need to have in your Django app the cities and countries, tweak the query from django-autocomplete-light, etc. Cheers,

Re: Want to get informations about bets Django hosting plateform

2020-09-23 Thread Carles Pina i Estany
is more standard than on Heroku (in case that I want to change it). Other than that I use VPSs with Docker. Cheers, -- Carles Pina i Estany https://carles.pina.cat -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from t

Re: Get datetime now, not at server initialisation

2020-10-28 Thread Carles Pina i Estany
n the upload time. In your code it was called on initialization time. Some time ago I had a similar code that caused a bug: in a ListView the "queryset = " is executed on startup time. For a dynamic one I should have used get_queryset() method. -- Carles Pina i Estany https://carle

Re: Get datetime now, not at server initialisation

2020-10-30 Thread Carles Pina i Estany
his explain how it works? I think that your questions might be answered with the callable code and the Django code. (I think that you had read the documentation but here it is: https://docs.djangoproject.com/en/3.1/ref/models/fields/#django.db.models.FileField.upload_to , it doesn't explai

Re: Deploy a finished django application

2020-12-03 Thread Carles Pina i Estany
he steps to deploy it. If the application needs to be packaged in Docker, virtual machine templates, create you a database user so the application can connect to it, etc. -- Carles Pina i Estany https://carles.pina.cat -- You received this message because you are subscribed to the Google Gro

Re: MultipleChoiceField form bug?

2020-12-22 Thread Carles Pina i Estany
bug because of using datetime.now() in a class variable when I wanted it the "now" that the view was used not the "now" when the application was started up. -- Carles Pina i Estany https://carles.pina.cat -- You received this message because you are subscribed to the Google

Re: MultipleChoiceField form bug?

2020-12-22 Thread Carles Pina i Estany
Meta: model = M2MModel fields = ['name'] ``` I would look at not using forms.MultipleChoiceField and use forms.ModelMultipleChoiceField(): then you should be able to pass queryset (first argument for the ModelMultipleChoiceField) and avoid the REF_OPTIONS=...

Re: CRUD Generator

2021-01-10 Thread Carles Pina i Estany
ls, Views, Forms (using django-crispy-forms), update the urls.py. But depends on the project it might make sense to use something that helps on this. Cheers, -- Carles Pina i Estany https://carles.pina.cat -- You received this message because you are subscribed to the Google Groups "Dja

Re: To start contribution from initial level

2021-01-20 Thread Carles Pina i Estany
to do it. There is quite a lot of documentation here: https://docs.djangoproject.com/en/dev/internals/contributing/ Cheers! -- Carles Pina i Estany https://carles.pina.cat -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscr