Re: Models as choices

2020-04-16 Thread shreehari Vaasistha L
i get this error when trying in your way: Cannot assign "2": "User.highest_degree" must be a "Degree" instance. On Thursday, April 16, 2020 at 5:31:07 PM UTC+5:30, Gavin Wiener wrote: > > Couldn't the User just have a ForeignKey on countries? > > On Thursday, April 16, 2020 at 12:52:07 PM UTC+8,

problem with admin panel

2020-04-16 Thread Cristhian Heredia Claure
Hello everyone Sorry if it's not correct to post here this issue that I have... In a LINUX environment, after all configuration for my project, when I try to log in the admin site, the style of the page of the admin panel is well stylized, as it should be. But in the test that I did in a

Re: Capture URL values in a CBV

2020-04-16 Thread Tim Johnson
On 4/15/20 7:24 PM, Gavin Wiener wrote: Hey Tim Hello Gavin: Thank you for your prompt reply. The bigger question is, what are you trying to achieve? I gotta know. I'm a retired programmer with 19 years doing CGI. Wrote and implemented my own framework. First in C, than C++ then rebol,

Re: Callable field in fieldset's field

2020-04-16 Thread 'Federico Capoano' via Django users
Is this the kind of thing you're looking for? https://github.com/openwisp/openwisp-firmware-upgrader/tree/1e9fa26d75a48ae9274c2708ea9a10134a2bb9d0/openwisp_firmware_upgrader/base/admin.py#L150-L186 Fed On Wednesday, April 15, 2020 at 4:15:48 PM UTC-5, Gagan Deep wrote: > > Greetings of the day,

Re: Cannot Redirect to other page

2020-04-16 Thread Gavin Wiener
I did include example, the last sentence of the first paragraph. You need to get rid of the inner function, I don't know why that was written. I needs to look more if request.method =="GET": return the regular page elif request.method == "POST": process the answers that have been sent by

Re: Cannot Redirect to other page

2020-04-16 Thread Gavin Wiener
I did include some examples, the last sentence of the first paragraph. You need to get rid of the inner function, I don't know why it was created. It needs to look more like this if request.method == "GET": On Wednesday, April 15, 2020 at 8:22:35 PM UTC+8, pui hei Li wrote: > > I am writing

Re: d

2020-04-16 Thread Muhammad Abdullah Nabeel
thank you, i got this On Mon, Feb 24, 2020 at 7:25 PM Motaz Hejaze wrote: > Ok i got it Mohammed , > > Kindly checkout PyInstaller > > Django is a web framework used to create websites and web services > > > On Mon, Feb 24, 2020 at 3:56 PM Kasper Laudrup

Re: d

2020-04-16 Thread Muhammad Abdullah Nabeel
thank you, i got this On Mon, Feb 24, 2020 at 6:56 PM Kasper Laudrup wrote: > Hi Muhammed, > > On 24/02/2020 13.22, Muhammad Abdullah Nabeel wrote: > > I want to share file as a software that can be installed. not > > necessarily it should be a website . like it can be given to another > >

Re: Cannot Redirect to other page

2020-04-16 Thread pui hei Li
Thank you for your reply, but I don't really understand how am i able to make it to the page I want, does it mean I need to write a new function in view and pass in the retrieved answer from user, then do the redirection/ rendering? Could you give me some hints about how the syntax would be,

Re: How to generate breadcrums

2020-04-16 Thread 'MH' via Django users
PS: I was just asking myself if I could somehow tell django what the hierarchy of views might be instead of defining the breadcrumbs for each view manually. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

How to generate breadcrums

2020-04-16 Thread 'MH' via Django users
Hi there I need some advice how to implement breadcrumbs in a base.html. I have already installed django-bootstrap-breadcrumbs, registered it in the apps and so on. So far I would say, it's working, Just for testing purposes it looks like this: {% load django_bootstrap_breadcrumbs

Re: Capture URL values in a CBV

2020-04-16 Thread Gavin Wiener
Hey Tim The bigger question is, what are you trying to achieve? With the DetailView, fetching the object with the primary key is already handled for you, as you've seen the object will already be available in the template. This website is very useful to know which functions are implemented

Re: Models as choices

2020-04-16 Thread Gavin Wiener
Couldn't the User just have a ForeignKey on countries? On Thursday, April 16, 2020 at 12:52:07 PM UTC+8, shreehari Vaasistha L wrote: > > how can i use model x values as choices for model y ? > > for eg: > class countries(models.Model): > country = models.CharField(max_length=200) > > def

Re: Cannot Redirect to other page

2020-04-16 Thread Gavin Wiener
So the "return" inside the inner function won't automatically "trigger". `redirect` is a shortcut function which constructs a HttpResponseRedirect. At the moment, you're calling the function, and the HttpResponseRedirect instance is returned from the function you're not actually doing anything

Re: AddTocard And cart Not Working Plese Help Me

2020-04-16 Thread Mohamed Johnson
Hello, Please take a look at the value stored on tour localStorage On Thu, Apr 16, 2020 at 08:06 kkwaqar786 wrote: > Error JavaScript Please Solve My Problems > > [image: er.JPG] > > [image: erc.JPG] > > > Admin: > username:waqar > password:1234 > > -- > You received this message because you

Re: user visit count

2020-04-16 Thread Motaz Hejaze
Great On Thu, 16 Apr 2020, 6:53 am shreehari Vaasistha L, wrote: > Done > > On Wednesday, April 15, 2020 at 6:55:37 PM UTC+5:30, Motaz Hejaze wrote: >> >> no standard for this , but thinking out loud with you .. >> >> you can make a many to many model ( table ) of 3 columns , first column >>

Re: Models as choices

2020-04-16 Thread shreehari Vaasistha L
Thanks for helping me out . On Thursday, April 16, 2020 at 2:34:13 PM UTC+5:30, Kasper Laudrup wrote: > > Hi Shreehari > > On 16/04/2020 10.17, shreehari Vaasistha L wrote: > > Object of type ValueError is not JSON serializable > > > > > > getting this above error > > > > First of all,

Re: Models as choices

2020-04-16 Thread Kasper Laudrup
Hi Shreehari On 16/04/2020 10.17, shreehari Vaasistha L wrote: Object of type ValueError is not JSON serializable getting this above error First of all, don't highjack other unrelated threads. Create your own with a descriptive subject. You get the error because of the lines: except

Re: Models as choices

2020-04-16 Thread shreehari Vaasistha L
Object of type ValueError is not JSON serializable getting this above error. here's my views.py class UserCreateApiView(CreateAPIView): serializer_class = UserCreateSerializer def post(self,request): try: serializer=UserCreateSerializer(data=request.data) if

Re: Models as choices

2020-04-16 Thread shreehari Vaasistha L
Object of type ValueError is not JSON serializable getting this above error On Thursday, April 16, 2020 at 12:57:16 PM UTC+5:30, Antje Kazimiers wrote: > > with a Foreign Key field, one-to-many relationship: > > https://docs.djangoproject.com/en/3.0/topics/db/examples/many_to_one/ > > Antje >

Re: Models as choices

2020-04-16 Thread Antje Kazimiers
with a Foreign Key field, one-to-many relationship: https://docs.djangoproject.com/en/3.0/topics/db/examples/many_to_one/ Antje On 4/16/20 6:52 AM, shreehari Vaasistha L wrote: > how can i use model x values as choices for model y ? > > for eg: > | > classcountries(models.Model): >  country