Re: how to pass the ID of a slected item in a list to ORM

2018-06-15 Thread Anthony Anonde
Sorry your question is a bit complicated, you have a form that contains a list 
of names and id, what data types are they contain in? Understand how the list 
box is structured will help to give you a better ans

-- 
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, send email to django-users@googlegroups.com.
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/b4131227-2319-4cb7-973c-40e8ae41b46f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Admin verification

2018-06-15 Thread Anthony Anonde
I will suggest to have a field with active set to false, so when the use signs 
in you cleaned the data send a notice to the admin, mean while the user info is 
save to the database but user account is not active because the field active is 
set to false. When the admin sees the user data he can choose to activate the 
user.
Hope that make sense 

-- 
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, send email to django-users@googlegroups.com.
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/a8efe997-b84f-448d-a595-3496de1e6f7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with get_absolute_url() in admin

2018-06-10 Thread Anthony Anonde
the example.com is am example django give for Site. Which means there is a 
way for you to manage more than one site at a time, basically using the 
site_id.
To you Questions, i don't understand why you want to hard code your uri 
routing like that when you can easily use the app_name and name convention 
which is more dynamic then hard coding it like that: 
for example at the model Transaction urls.py 
app_name = "trans"
url(r'(?P-/d+)$', views.func, name='account_trans'),

def get_absolute_url(self):
return reverse("trans:account_trans",  kwargs={"pk":self.pk})


and you will be just fine hope this help



On Sunday, June 10, 2018 at 12:30:51 PM UTC+1, Joakim Hove wrote:
>
> Hello,
>
> I have a model `Transaction` which can be viewed at the url: 
> /transaction/view/$ID/ - if I just enter that url in the browser, or in 
> template everything works. But when I have the following get_abolute_url() 
> method:
>
> def get_absolute_url(self):
>  return "/transaction/view/{}/".format( self.id )
>
> things do not work from the Admin. When I click on the "View on Site" link 
> i am redirected to "http://example.com/transaction/view/23635/; and I get 
> an error message about failed XML parsing. I have no clue where the "
> example.com" address comes from - that string is not in my codebase. If I 
> hardcode the get_absolute_url to:
>
> def get_absolute_url(self):
>  return "http://127.0.0.1:8000/transaction/view{}/".format(self.id)
>
> That works in development, but needless to say that is not a very good 
> approach.
>
> I am on Django 1.10
>
>
> Regard Joakim
>
>
>

-- 
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, send email to django-users@googlegroups.com.
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/5678b297-2693-4ae8-b249-08e42713ebf7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.