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 relationship.

2) Django class-based view.

3) For example, template

> {{obj.get_url}} <- error Site does not exists [set site_id or use 1)]


Model
class Model(models.Model):
      def get_absolute_url(self):

    return 'http://{}{}'.format(Site.objects.get_current(????).domain,
                                reverse(viewname='product',
                                        args=[self.slug]))


Thanks, also i do not want to change site_id dynamically (thread) or use 
site through model-model.

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/32ee2f28-8d2b-4a14-ba87-c6150fd88399%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to