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. 
https://docs.djangoproject.com/en/2.2/ref/contrib/admin/#django.contrib.admin.ModelAdmin.formfield_overrides


2. 
https://docs.djangoproject.com/en/2.2/ref/contrib/admin/#django.contrib.admin.ModelAdmin.formfield_for_manytomany


Neither of these seem to work for me with a minimally adjusted widget 
(see below). This is what I have done ...


#common.widgets.py (my app here is "common")

from django.contrib.admin import widgets


class CommonFilteredSelectMultiple(widgets.FilteredSelectMultiple):
    """ If we can only get this to execute we can adjust the context """

   def get_context(self, name, value, attrs):
        # apart from the print call, this matches FilteredSelectMultiple
print("\n10 admin.widgets")
    context = super().get_context(name, value, attrs)
    context['widget']['attrs']['class'] = 'selectfilter'
    if self.is_stacked:
    context['widget']['attrs']['class'] += 'stacked'
    context['widget']['attrs']['data-field-name'] = self.verbose_name
    context['widget']['attrs']['data-is-stacked'] = 
int(self.is_stacked)

    return context



#common.admin.py

from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from django.db import models
from common.utils import (
    is_sharedsds, user_sharedsds_admin, userprofile_sharedsds_admin,
)
from common.models import UserProfile
from common.widgets import CommonFilteredSelectMultiple


class CommonUserAdmin(UserAdmin):

    def formfield_for_manytomany(self, db_field, request, **kwargs):
    if db_field.name == "groups":
    kwargs["widget"] = CommonFilteredSelectMultiple
    print("\n23 common.admin")
    return super().formfield_for_manytomany(db_field, request, 
**kwargs)


    model = get_user_model()
    extra = 0
    readonly_fields = [
    "last_login",
    "is_staff",
    "is_active",
    "date_joined",
    "groups",
    ]
    get_readonly_fields = user_sharedsds_admin
    fieldsets = [
    (
    "More detail",
    {
    "description": "Server date/times are UTC rather than 
local time",

    "classes": ("",),
    "fields": (
    "password",
    "last_login",
    "username",
    "first_name",
    "last_name",
    "email",
    "is_staff",
    "is_active",
    "groups",
    "date_joined",
    ),
    },
    ),
    ]

    class UserProfileInline(admin.StackedInline):
    def has_add_permission(self, request=None, obj=None):
    return False

    def has_delete_permission(self, request=None, obj=None):
    return False

    model = UserProfile
    extra = 0
    verbose_name_plural = "Profile"
    readonly_fields = ("company", "modified",)
    get_readonly_fields = userprofile_sharedsds_admin
    fieldsets = (
    (
    "Cellphone, Company",
    {
    "classes": ("collapse",),
    "fields": (
    "cellphone",
    "company",
    #'otp',
    #'sms',
    #'fluency',
    ),
    },
    ),
    (
    "Preferences",
    {
    "classes": ("collapse",),
    "fields": (
    "code_preference",
    "subsections",
    "licensed_data",
    "open_data",
    "ingredient_data",
    "modified",
    ),
    },
    ),
    )
    inlines = [
    UserProfileInline,
    ]


admin.site.register(get_user_model(), CommonUserAdmin)

Thanks for any help ...

Cheers

Mike

--
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 web visit 
https://groups.google.com/d/msgid/django-users/ed2c0120-001b-f365-40ca-35ecd2820aa3%40dewhirst.com.au.


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 users,
> >
> > Is there a default max length for TextField which is enforced in the
> > database? We are using PostgreSQL and I don't want users (hackers) to
> > flood our database with megabytes of meaningless text.
>
> Uri
>
> In your model create a clean() method. If it exists [1] this is called
> by django forms prior to a save. If you access the field via an API or
> unit tests you have to call it specifically. In there you can test for a
> maximum size - or anything else really.
>
> class SomeModel(models.Model):
>
>  long_text = models.TextField()
>
>  def clean(self):
>  txt = self.long_text or ""
>  if len(txt) > 1:
>  # this needs to be reported to the user because it will
> prevent saving
>  # happens automatically in the Admin ...
>  raise ValidationError("Too much meaningless text")
>
>
> [1]
>
> https://docs.djangoproject.com/en/2.2/topics/forms/modelforms/#overriding-the-clean-method
>
> Cheers
>
> Mike
>
>
> >
> > Thanks,
> > Uri.
> > אורי
> > u...@speedy.net 
> > --
> > 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 web visit
> >
> https://groups.google.com/d/msgid/django-users/CABD5YeFq%3DUAGJSDvtMJetb4LknvGhCWtK1ie%3DEvUsJVB_n2B4g%40mail.gmail.com
> > <
> https://groups.google.com/d/msgid/django-users/CABD5YeFq%3DUAGJSDvtMJetb4LknvGhCWtK1ie%3DEvUsJVB_n2B4g%40mail.gmail.com?utm_medium=email&utm_source=footer
> >.
>
> --
> 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 web visit
> https://groups.google.com/d/msgid/django-users/4b29a5e5-b328-3857-6d21-482e5018f5bc%40dewhirst.com.au
> .
>

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/CABD5YeH2VfYusEuKCTKC0Za%2Bjcq93ZXd0qC5J2mTXMQf59A%3DSw%40mail.gmail.com.


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):
> comment = models.TextField(validators=[MaxLengthValidator(200)])
>
> --
> 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 web visit
> https://groups.google.com/d/msgid/django-users/CACNsr29nJmR4ZeOpVGnTA75HZuBgF92j25Q7NPzGFyyHq6qyUg%40mail.gmail.com
> 
> .
>

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/CABD5YeEav3AazpXFmgNrPgj1bZw3UB6%2B1mEjx4VHu5GyOk1SZg%40mail.gmail.com.


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'])
print(geodata['country_name'])
print(geodata['latitude'])
print(geodata['longitude'])

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/34b7736d-f946-451b-b83b-de72d3329da0%40googlegroups.com.


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 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 web visit 
https://groups.google.com/d/msgid/django-users/CAEr6%3Ddz_oT2M74cx%3D9WP2R7R2tSyjMVrYxuJ4ezrLGn1Fp-GoQ%40mail.gmail.com.


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 = request.META.get('HTTP_X_FORWARDED_FOR', '')
> response = requests.get('http://freegeoip.net/json/%s' % ip_address)
> geodata = json.loads(response)
> print(geodata['ip'])
> print(geodata['country_name'])
> print(geodata['latitude'])
> print(geodata['longitude'])
>
> --
> 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 web visit
> https://groups.google.com/d/msgid/django-users/34b7736d-f946-451b-b83b-de72d3329da0%40googlegroups.com
> 
> .
>

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/CAP5HUWrPwnwpST5gR0%2BEw496N%3Df6hfCJzFbawAXXT5zRRdLkzg%40mail.gmail.com.


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 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'])
>> print(geodata['country_name'])
>> print(geodata['latitude'])
>> print(geodata['longitude'])
>>
>> --
>> 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 web visit
>> https://groups.google.com/d/msgid/django-users/34b7736d-f946-451b-b83b-de72d3329da0%40googlegroups.com
>> 
>> .
>>
>

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/CAP5HUWpv-RfgPCkRspNAdzm4Qxpy2Za3hpjjmO2qADEQK0opvg%40mail.gmail.com.


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 of type "requests.models.Response"
n'est pas serializable according to the conversion table (mentioned in doc).

A solution would be to use
>
> geodata = response.json()
>
>

On Mon, Jan 6, 2020 at 2:20 PM Yash Garg  wrote:

> 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'])
> print(geodata['country_name'])
> print(geodata['latitude'])
> print(geodata['longitude'])
>
> --
> 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 web visit
> https://groups.google.com/d/msgid/django-users/34b7736d-f946-451b-b83b-de72d3329da0%40googlegroups.com
> 
> .
>

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/CAJenkLBxhDixbTDVtB_rbg%3D29QeLYQYwVtUaaHGgVWss94jQ%3DA%40mail.gmail.com.


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 
(x86)\Python38-32\Lib\site-packages\django\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\Gupta
 Consulting\AppData\Local\Microsoft\WindowsApps;

Sent from Mail for Windows 10

From: Mohamed A
Sent: Friday, January 3, 2020 11:13 AM
To: django-users@googlegroups.com
Subject: Re: ModuleNotFoundError: No module named 'datetime'

How about deleting your virtualenv and recreating a new one.
It may be located here ::: C:\Users\\.virtualenvs\cargo

When reactivated, could you please provide as with the results of "echo $PATH" 
from cmdline.


On Fri, Jan 3, 2020 at 7:09 PM sanusi ibrahim adekunle 
 wrote:
You do not have datetime module installed on your virtual environment. 

To install, type this command: "pip install datetime"

On Fri, Jan 3, 2020, 18:37 bhushan Gupta  wrote:
I want to use Django to build a simple portal. I have done the following on 
Windows 10
installed Python 3.8 and pip
Installed virtualenv 
Created an env 'cargo' 
Installed Djengo 3.0.1
Set the 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 (x86)\Python38-32\Lib\site-packages\django\bin\

I have activated the environment - (cargo) C:\Users\Gupta Consulting\Envs\cargo>
When I start a project using - python django-admin.py startproject cargo  I get 
the following error:
(cargo) C:\Users\Gupta Consulting\Envs\cargo>django-admin.py startproject 
myproject
Traceback (most recent call last):
  File "C:\Users\GUPTAC~1\Envs\cargo\Scripts\django-admin.py", line 2, in 

    from django.core import management
  File "c:\users\guptac~1\envs\cargo\lib\site-packages\django\__init__.py", 
line 1, in 
    from django.utils.version import get_version
  File 
"c:\users\guptac~1\envs\cargo\lib\site-packages\django\utils\version.py", line 
1, in 
    import datetime
ModuleNotFoundError: No module named 'datetime'

I commented out "import datetime" from the vsersion.py file. Then it did not 
find the next module in in the version.py file.

Looks like there is a setup problem.
Any help will be appreciated
Thanks. 

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/17cf2d01-94f8-45e7-a4f6-171e93e32176%40googlegroups.com.
-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/CAGvEB52i2MeHcn%2BwTpiidXtVRCOQogFxiz6Gg_yuCJ5%2B7Mmq-g%40mail.gmail.com.
-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/CAJenkLBmGfz_wQ9rsZC5p_ByjapcJqwHnYgR6LRbRkcDNYVwrw%40mail.gmail.com.

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/5e136c5a.1c69fb81.707ff.aed1%40mx.google.com.


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 
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 web visit 
https://groups.google.com/d/msgid/django-users/93458dd1-54da-7978-77f6-9a4f9e7446c4%40stacktrace.dk.


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 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 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 web visit
> https://groups.google.com/d/msgid/django-users/93458dd1-54da-7978-77f6-9a4f9e7446c4%40stacktrace.dk
> .
>

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/CAJenkLABwpEsyr_Q%2BH5fFSP8SeKR%3DcZ2SfjUkpKAKhppX97jRA%40mail.gmail.com.


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 this 
method below:

def __init__(self, attrs=None):
# Use slightly better defaults than HTML's 20x2 box
default_attrs = {'cols': '40', 'rows': '10'}
if attrs:
default_attrs.update(attrs)
super().__init__(default_attrs)


I need change value from *default_attrs = {'rows':'10'}* for *{'rows':'4'} *

 How can I override this in my model or in my view?

Thanks for watching!

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/adef9112-df5b-4b03-9861-97d1495dd00b%40googlegroups.com.


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 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 this
> method below:
>
> def __init__(self, attrs=None):
> # Use slightly better defaults than HTML's 20x2 box
> default_attrs = {'cols': '40', 'rows': '10'}
> if attrs:
> default_attrs.update(attrs)
> super().__init__(default_attrs)
>
>
> I need change value from *default_attrs = {'rows':'10'}* for
> *{'rows':'4'} *
>
>  How can I override this in my model or in my view?
>
> Thanks for watching!
>
> --
> 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 web visit
> https://groups.google.com/d/msgid/django-users/adef9112-df5b-4b03-9861-97d1495dd00b%40googlegroups.com
> 
> .
>

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/CAJenkLDF5My0GH3mFdCPftEq%3DeH0Mep4O83jPK4OY0Tj8Jk5LQ%40mail.gmail.com.


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 examples for me?

I can easily do this with jQuery, but I want to learn how to do this using
just Django and for that I still have little experience in method override.

best regards!

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/CAGE5jT83u5wahCwwzfF2b0td_MzEgj9L-DV4e9DZH8mcWq7G0Q%40mail.gmail.com.


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
not the actual message in the email content
4. This is not an actual chat messaging

I appreciate if someone has implemented this kind of app or what are the
possible features/functions available by default in Django FWK so that we
can make use of such features.

Best regards,
~Ram

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/CA%2BOi5F2uREqyN4POdqxyK-qK7Odj%2B9uQKwneJ00J-7f-DNGScQ%40mail.gmail.com.


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 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 examples for me?
>
> I can easily do this with jQuery, but I want to learn how to do this using
> just Django and for that I still have little experience in method override.
>
> best regards!
>
> --
> 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 web visit
> https://groups.google.com/d/msgid/django-users/CAGE5jT83u5wahCwwzfF2b0td_MzEgj9L-DV4e9DZH8mcWq7G0Q%40mail.gmail.com
> 
> .
>

-- 
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 web visit 
https://groups.google.com/d/msgid/django-users/CAJenkLCaqXO15urag46XLKzpOoNwbzOay5H1n-Pn3NovhssL%3DA%40mail.gmail.com.