• Members 47 posts
    May 18, 2018, 8:16 a.m.

    Hi rafalp,

    I have one small change in users/profilfields/basefields.py and two added classes in users/profilfields/default.py. Would it be possible to change/add this in any other way than directly in these files?
    When pushing to the server, venv of course isn't following and those changes never makes it to production.

    Best regards
    Mike

  • May 18, 2018, 8:20 a.m.
    check_box

    Marked as best answer by May 18, 2018, 1:14 p.m..

    There is no need for that.

    What you should do instead is to create custom python modules where it is comfortable for you (eg. in your forum package right next to your settings.py) that would import code from basefields.py or default.py define new classes for your fields that you would then specify paths to in your settings.py.

    Your settings.py after change may have setting like this:

    # Profile fields
    
    MISAGO_PROFILE_FIELDS = [
        {
            'name': _("Personal"),
            'fields': [
                'myforum.profilefields.FullNameField',
                'myforum.profilefields.OrganizationField',
                'myforum.profilefields.GenderField',
                'myforum.profilefields.BioField',
                'myforum.profilefields.LocationField',
            ],
        },
        {
            'name': _("Contact"),
            'fields': [
                'misago.users.profilefields.default.TwitterHandleField',
                'misago.users.profilefields.default.SkypeIdField',
                'misago.users.profilefields.default.WebsiteField',
            ],
        },
        {
            'name': _("IP address"),
            'fields': [
                'misago.users.profilefields.default.JoinIpField',
                'misago.users.profilefields.default.LastIpField',
            ],
        },
    ]
    
  • Members 47 posts
    May 18, 2018, 1:06 p.m.

    Thanks a lot. That works.

    Best regards
    Mike