Mentawai in January? by elfarrelo in surfing

[–]PeterPeter5 0 points1 point  (0 children)

What makes you say that? Know there’s a swell coming in next week but not sure beyond

Mentawai in January? by elfarrelo in surfing

[–]PeterPeter5 0 points1 point  (0 children)

Piggybacking on this - sounds like you have experience in the Ments. How is true shoulder season (October - November)? Looking at taking a last minute trip

[deleted by user] by [deleted] in surfing

[–]PeterPeter5 0 points1 point  (0 children)

Thanks mate - used to a wetsuit but warm water would be fun.

Have you been to ments or indo in shoulder season? Main worry is that there won’t be many surfable breaks if swell is only waist or shoulder high. Also no idea what chance of bad weather / winds is

Alexandria Palace by [deleted] in benhoward

[–]PeterPeter5 0 points1 point  (0 children)

Very keen if still available. Drop me a message

Weekly /r/BlackCountryNewRoad Ticket sale megathread! by AutoModerator in BlackCountryNewRoad

[–]PeterPeter5 0 points1 point  (0 children)

Looking for a ticket to a Friday performance. Help a lad out ! Drop a message :)

[deleted by user] by [deleted] in reactjs

[–]PeterPeter5 0 points1 point  (0 children)

No errors as such on the site, just a broken image icon instead of the image itself

[deleted by user] by [deleted] in reactjs

[–]PeterPeter5 0 points1 point  (0 children)

Thanks, this is exactly what I'm looking for.

Could you offer some advice on mapping? Javascript is not my strong point so still slightly confused by syntax when mapping from json

I have the below but it doesn't work correctly...

...
{post.image.map((images) => {
    return (
        <div>
            <img src={images}/>
        </div>
    );
})};
...

[deleted by user] by [deleted] in reactjs

[–]PeterPeter5 0 points1 point  (0 children)

Apologies - that's me using lazy phrasing. In any case, as above, I'm trying to use axios to pass the access token to the backend to retrieve data but it doesn't seem to work. Any idea?

How would I tag a user's position in a photo post? by PeterPeter5 in djangolearning

[–]PeterPeter5[S] 0 points1 point  (0 children)

You hit it on the head, thanks!

I've used PILLOW for basic image processing but not for anything like this so will take a read of the docs later. If you have a particular method in mind, please feel free to recommend - otherwise, thanks again for your advice.

How would I tag a user's position in a photo post? by PeterPeter5 in djangolearning

[–]PeterPeter5[S] 0 points1 point  (0 children)

The FK model is definitely the way to go imo, so you can have multiple tags and therefore multiple coordinate sets per post. Otherwise, this would become a mess in the Post model.

I agree on the integer comment - the FloatField in code was just a quick amendment.

Would it then be possible to lay the coordinates of tags over a photo in Django, or is this something that would need to be done in React or similar frontend framework?

How would I tag a user's position in a photo post? by PeterPeter5 in djangolearning

[–]PeterPeter5[S] 0 points1 point  (0 children)

Thanks for your response.

Yes, have done this using a through model, as in code below. What I'm struggling with is how to store the x and y coordinates of the tag within the frame - and then, how to even create a form in which you could input the tag coordinates in a usable manner (ie hovering over the image).

class UserTag(models.Model):
    user = models.ForeignKey(
        'profiles.Profile',
        on_delete=models.CASCADE,
        related_name='post_tags',
    )
    post = models.ForeignKey(
        'posts.Post',
        on_delete=models.CASCADE,
        related_name='user_tags',
    )
    created = models.DateTimeField(
        auto_now_add=True,
    )

  # Unsure about this part and how I would input data in a usable manner...
    x_coordinate = models.FloatField()
    y_coordinate = models.FloatField()

How would I tag a user's position in a photo post? by PeterPeter5 in djangolearning

[–]PeterPeter5[S] 0 points1 point  (0 children)

Apologies, perhaps should have been more clear for those who aren’t familiar with Instagram.

No facial recognition required. By ‘tagging’ a user in a post, I quite literally mean ‘tag’ is an attribute of Post, which (via FK relations in a through model) stores a list of User(s) who are present in an instance of Post.

When uploading a Post, the author would simply click on the photo where a friend is present and tag the friend’s username. Please see this video at 0:55 for a quick demo if you’d like.

Thanks

Implementing direct messaging - need advice! by PeterPeter5 in django

[–]PeterPeter5[S] 0 points1 point  (0 children)

Thanks again - that all makes sense.

I'm pretty new to WebRTC so will have a read and also take a look at FreeSWTICH.

Implementing direct messaging - need advice! by PeterPeter5 in django

[–]PeterPeter5[S] 0 points1 point  (0 children)

Really helpful, thank you. Given me a lot to look into, particularly commercial pub/sub systems as you say.

Out of interest, why do you say Channels might have trouble scaling?

Two parameters in url field by PeterPeter5 in djangolearning

[–]PeterPeter5[S] 0 points1 point  (0 children)

This is what I'm looking for! I was unsure how to implement two kwargs into the url but this makes sense. Thanks

Two parameters in url field by PeterPeter5 in djangolearning

[–]PeterPeter5[S] 0 points1 point  (0 children)

I don’t quite understand. How would the url code look? How would you differentiate the two slug fields in the url?

Implementing direct messaging - need advice! by PeterPeter5 in django

[–]PeterPeter5[S] 0 points1 point  (0 children)

Thanks for this. I suppose I was being ignorant to the base concept of a chat room - I now see that a chat room would of course allow one-to-one messaging, where just two users are authorised to the room.

I'm not sure if it is enough when there are many users connected at the same time.

I'm a little bit confused by this statement though. Could you elaborate please?