Re: Get current site inside model

2017-01-14 Thread Max
Melvyn Sopacua, i will look it. Thank you all. -- 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 post to this group,

Re: Get current site inside model

2017-01-14 Thread Melvyn Sopacua
On Friday 13 January 2017 13:15:43 Max wrote: > Vijay Khemlani, i think my question have not a lot of details. More > 1) Django site framework (works with request.get_host() without > Site_id). I can get the current site with > Site.objects.get_current(*request*), shortcuts (get_current_site) or >

Re: Get current site inside model

2017-01-13 Thread Max
For example, also i can change queryset with "fake site" listview -> request -> set queryset site -> template. maybe it will be work, but also i use rss/sitemaps. they will not use abs path, because based on Model. You could generate the urls on the view and pass them already > generated to the

Re: Get current site inside model

2017-01-13 Thread Vijay Khemlani
I'm not gonna start on the "cool" part You could generate the urls on the view and pass them already generated to the template On 1/13/17, Max wrote: > {{ domain }}{{ ob.get_absolute url }} - is not cool , i set site with > context proccesor for domain > > Once again, if you don't have a default

Re: Get current site inside model

2017-01-13 Thread Max
{{ domain }}{{ ob.get_absolute url }} - is not cool , i set site with context proccesor for domain Once again, if you don't have a default site_id or the request object > available inside the method, then what do you expect it to return? I'm > not asking programatically, but logically, if s

Re: Get current site inside model

2017-01-13 Thread Vijay Khemlani
Once again, if you don't have a default site_id or the request object available inside the method, then what do you expect it to return? I'm not asking programatically, but logically, If you only care about the template the you can concatenate the domain and the absolute path in the template itsel

Re: Get current site inside model

2017-01-13 Thread Max
Vijay Khemlani, i think my question have not a lot of details. More 1) Django site framework (works with request.get_host() without Site_id). I can get the current site with Site.objects.get_current(*request*), shortcuts (get_current_site) or through model. But i have only one model with site rel

Re: Get current site inside model

2017-01-13 Thread Vijay Khemlani
You would need to pass it as argument, or set a default Site, otherwise it doesn't make sense For example, when calling the method from the shell (not a web request) what will you expect it to return? On 1/13/17, Max wrote: > Hi, guys. I want to get absolute url for Model with domain based on re

Get current site inside model

2017-01-13 Thread Max
Hi, guys. I want to get absolute url for Model with domain based on request (there is not SITE_ID in the settings.py). How? -- 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