These are chat archives for django/django

15th
Jun 2017
Pavel Burns
@63phc
Jun 15 2017 09:07 UTC

hello , im have a problem with
I do everything according to the instructions, but not as on the backend does not want the image editing window

base.py (settings):

from easy_thumbnails.conf import Settings as thumbnail_settings

INSTALLED_APPS = [
 [..]
'easy_thumbnails',
'image_cropping',
]


THUMBNAIL_PROCESSORS = (
    'image_cropping.thumbnail_processors.crop_corners',
) + thumbnail_settings.THUMBNAIL_PROCESSORS

admin.py:

from image_cropping import ImageCroppingMixin

@admin.register(Course)
class AdminCourse(ImageCroppingMixin, admin.ModelAdmin):
    prepopulated_fields = {'slug': ('title',)}

model.py:

from image_cropping import ImageRatioField
 image_preview = models.ImageField(verbose_name='picture')
    cropping = ImageRatioField('image_preview', '430x360')
Somebody uses the package?
And is there an alternative
Roman Tolkachyov
@romantolkachyov
Jun 15 2017 09:11 UTC
@63phc look at https://sorl-thumbnail.readthedocs.io/en/latest/ (stable solution)
Pavel Burns
@63phc
Jun 15 2017 09:37 UTC
@romantolkachyov thx ,but it's not what I need, need cropping images
Roman Tolkachyov
@romantolkachyov
Jun 15 2017 09:38 UTC
Pavel Burns
@63phc
Jun 15 2017 09:45 UTC
@romantolkachyov need such a cropping to most choose the size of the image in the admin area
alt
It seems I found, I will use
downwriter
@downwriter
Jun 15 2017 15:21 UTC
interested in creating a "helpdesk/FAQ' chat bot with django
Fabian
@fabiand93
Jun 15 2017 15:55 UTC
Hy
to get a session id and know wich user is logged only with the Token?
is there a way to*
Fabian
@fabiand93
Jun 15 2017 16:07 UTC
?
Roman Tolkachyov
@romantolkachyov
Jun 15 2017 17:04 UTC
@fabiand93 what "Token" you talk about?
Fabian
@fabiand93
Jun 15 2017 17:05 UTC
I'm creating a middleware to check if a user is active so if y use a request.META'HTTP_AUTHORIZATION' I get on a str the token
with that user I want to check the last time active of the user
@romantolkachyov that's the main idea
J. Dalton Childers
@jdaltonchilders
Jun 15 2017 21:50 UTC
Hey everyone, I’m working on a model design and I’m little stuck. I’m got this model called Proposal and for each model instance I have a PI (Principal Investigator) with one or more Co-PIs. I was thinking I could just do a FK for the PI, since this individual is significant to the record, but I can’t think of the best way to handle the Co-PIs. It’d be nice if they could both pull names from a separate table, because I’d like for some auto-complete (with possible editing) to take place. For each PI or Co-PI I will need to store their name, email, department. I thought about a JSON field for the Co-PIs with a FK relation to the PI table…but I don’t know if that’d work the way I think it will or how to handle that on the front-end. :worried:
J. Dalton Childers
@jdaltonchilders
Jun 15 2017 22:04 UTC
Or maybe a many-to-many, but I’ll need to create the Co-PI if they don’t exist.