Re: Override value of a TextField class method.

2020-01-06 Thread Mohamed A
Hint:.. __init__ is a constructor not any method. Le lun. 6 jan. 2020 à 23:02, Fabio da Silva Pedro < fabio.silvape...@gmail.com> a écrit : > Easy. You need to provide attrs as dict to the new object. >> >> > Ok, I thought about that too, but I don't know how to do it, I copied the > whole

Looking for offline messaging sample app

2020-01-06 Thread Ram
Hi, We are developing a classifieds module and for which we need to add 1. offline messaging feature so that registered members can submit messages each other 2. messages will be persisted in each member profile's inbox 3. members will be notified in their registered email about new message but

Re: Override value of a TextField class method.

2020-01-06 Thread Fabio da Silva Pedro
> > Easy. You need to provide attrs as dict to the new object. > > Ok, I thought about that too, but I don't know how to do it, I copied the whole method and pasted it into my model and tried to access its superclass, but I didn't get it! Maybe I'm doing something wrong yet. Would you have any

Re: Override value of a TextField class method.

2020-01-06 Thread Mohamed A
Easy. You need to provide attrs as dict to the new object. Le lun. 6 jan. 2020 à 21:36, Fabio da Silva Pedro < fabio.silvape...@gmail.com> a écrit : > Hi everyone! > > this is an excerpt line from my model > > observacoes = models.TextField(null=True, blank=True, > verbose_name='Informações

Override value of a TextField class method.

2020-01-06 Thread Fabio da Silva Pedro
Hi everyone! this is an excerpt line from my model observacoes = models.TextField(null=True, blank=True, verbose_name='Informações complementares') How i do override a field type *TextField* and change your internal *class value Textarea*, this is a widget from TextField Class and override

Re: ModuleNotFoundError: No module named 'datetime'

2020-01-06 Thread Mohamed A
Can you please check whether the python interpreter inside the virtual environment is python 2 or python 3 ? In order to do so, you need to goto to the virtualenv folder, activate cargo env, and then check "python -V" On Mon, Jan 6, 2020 at 7:10 PM Kasper Laudrup wrote: > Hi Bhushan, > > On

Re: ModuleNotFoundError: No module named 'datetime'

2020-01-06 Thread Kasper Laudrup
Hi Bhushan, On 06/01/2020 18.20, Bhushan Gupta wrote: Recreated virtual environment – no change. Inside your virtual environment, what's the output of: # pip freeze ? Kind regards, Kasper Laudrup -- You received this message because you are subscribed to the Google Groups "Django

RE: ModuleNotFoundError: No module named 'datetime'

2020-01-06 Thread Bhushan Gupta
Recreated virtual environment – no change. Here is the PATH: PATH=C:\Program Files (x86)\Python38-32\;C:\Program Files (x86)\Python38-32\Python.exe;C:\Program Files (x86)\Python38-32\Scripts\;C:\Program Files (x86)\Python38-32\Lib\site-packages;C:\Program Files

Re: JSONDecodeError

2020-01-06 Thread Mohamed A
According to the documentation > If the data being deserialized is not a valid JSON document, a > JSONDecodeError > will > be raised. > however the object response, which it

Re: JSONDecodeError

2020-01-06 Thread Integr@te System
or another way django httpxforwardedfor module. Nice. On Mon, Jan 6, 2020, 22:56 Integr@te System wrote: > Hi, > > Maybe your module requests not present sufficient and check requests api > module to use. > > > On Mon, Jan 6, 2020, 20:20 Yash Garg wrote: > >> JSONDecodeError >> Exception

Re: JSONDecodeError

2020-01-06 Thread Integr@te System
Hi, Maybe your module requests not present sufficient and check requests api module to use. On Mon, Jan 6, 2020, 20:20 Yash Garg wrote: > JSONDecodeError > Exception Value: > > Expecting value: line 1 column 1 (char 0) > > > why i'm getting this error? > > views.py- > > ip_address =

How to inherit a model for Custom User with Different Module

2020-01-06 Thread Pravin Yadav
Hello Friends, We have created the three groups. 1:- Super User 2:- Company 3:- User And also We have created a custom user in django admin. We want to create a separate module but same database table. Kindly help us. Thanks, Pravin Kumar Yadav 8743064255 -- You received this message because

JSONDecodeError

2020-01-06 Thread Yash Garg
JSONDecodeError Exception Value: Expecting value: line 1 column 1 (char 0) why i'm getting this error? views.py- ip_address = request.META.get('HTTP_X_FORWARDED_FOR', '') response = requests.get('http://freegeoip.net/json/%s' % ip_address) geodata = json.loads(response) print(geodata['ip'])

Re: TextField

2020-01-06 Thread אורי
Sorry, I didn't see that you already wrote that. אורי u...@speedy.net On Mon, Jan 6, 2020 at 6:43 AM Abu Yusuf wrote: > > No, there is no limit for textfield. But you can do the hack using this: > > from django.core.validators import MaxLengthValidator > class Comment(models.Model): >

Re: TextField

2020-01-06 Thread אורי
It's better to add a validator in the model: text = models.TextField(verbose_name=_('your message'), max_length=5, validators=[MaxLengthValidator(limit_value=5)]) אורי u...@speedy.net On Mon, Jan 6, 2020 at 6:11 AM Mike Dewhirst wrote: > On 6/01/2020 2:24 pm, אורי wrote: > > Django

How can I use a custom widget in the Admin for a custom user

2020-01-06 Thread Mike Dewhirst
Sorry for being boring  ... I cannot persuade the UserAdmin to use a custom widget instead of the one it usually uses. If you can point out where I'm going wrong I will be indebted to you.  I have tried two ways of using a custom widget ... 1.