Re: Django rest framework Best way to link and display value.

2018-01-04 Thread cherngyorng
So foreign key is fine. Thank you. I thought that maybe theres a better way than using foreign key. On Friday, January 5, 2018 at 4:38:58 PM UTC+9, Dylan Reinhold wrote: > > | But i have a feeling this is a very troublesome way to do it. > > Why do you have this feeling? Foreign key to another ta

Re: Django rest framework Best way to link and display value.

2018-01-04 Thread Dylan Reinhold
| But i have a feeling this is a very troublesome way to do it. Why do you have this feeling? Foreign key to another table sounds fine. If you don't think that list will change much you could do it as a choice. https://docs.djangoproject.com/en/2.0/ref/models/fields/#choices Dylan On Thu, Jan 4

Re: Django rest framework import data from one table to another

2018-01-04 Thread cherngyorng
This is my stackoverflow link which may be able to make it look more easier to understand: https://stackoverflow.com/questions/48109034/django-rest-framework-import-data-from-one-table-to-another On Friday, January 5, 2018 at 3:47:23 PM UTC+9, chern...@gmail.com wrote: > > I am doing a django r

Re: Django rest framework import data from one table to another

2018-01-04 Thread cherngyorng
This is my stackoverflow link which may be able to make it look more easier to understand On Friday, January 5, 2018 at 3:47:23 PM UTC+9, chern...@gmail.com wrote: > > I am doing a django rest framework API for ios application. And currently, > i am doing a function between user and family. > Le

Re: Django rest framework viewset and its url

2018-01-04 Thread cherngyorng
> > Ah, i decide to instead of using 2 viewset for a single model, i use 1 > viewset and 1 APIView for it. > Therefore i deleted both post in here and in stackoverflow. Sorry for the > trouble. On Friday, January 5, 2018 at 1:56:44 PM UTC+9, Dylan Reinhold wrote: > > That link is not

Django rest framework Best way to link and display value.

2018-01-04 Thread cherngyorng
I have a table called family, you can see the models.py below. My partner told me that he wanted the relationship to change to this kind 1,Father 2,Mother 3,Husband 4,Wife 5,Son 6,Daughter 7,Aunt 8,Uncle 9,Nephew 10,Niece 11,Others This is where he will sent me the id (eg:5) and i will save that

Django rest framework import data from one table to another

2018-01-04 Thread cherngyorng
I am doing a django rest framework API for ios application. And currently, i am doing a function between user and family. Let me explain my logic between these two. User= current user (an account that can be use to login) Family = current user's family member eg:father mother (it is not an acco

Re: Django Admin Form clean method override only working for one exception

2018-01-04 Thread dean raemaekers
Thanks Julio! This worked. On Thursday, January 4, 2018 at 2:59:16 PM UTC+2, Julio Biason wrote: > > Hi Dean, > > You forgot to call the form clean method (the first line after your `def > clean` should be `super().clean()` as shown in the documentation: > https://docs.djangoproject.com/en/2.0/

Re: Django rest framework viewset and its url

2018-01-04 Thread Dylan Reinhold
That link is not valid, and without seeing your views no one will be able to help. Dylan On Thu, Jan 4, 2018 at 7:18 PM, wrote: > For a better and more detailed question i ask, refer to here : > https://stackoverflow.com/questions/48106733/django- > rest-framework-viewset-and-url-mixup > > In m

Re: How to set up polls/admin url in Django Tutorial pt 2

2018-01-04 Thread Luna Tuna
I resolved this by observing that the admin stuff for an app shows up on mainsite/admin once registered in admin.py. -- 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 ema

Django rest framework viewset and its url

2018-01-04 Thread cherngyorng
For a better and more detailed question i ask, refer to here : https://stackoverflow.com/questions/48106733/django-rest-framework-viewset-and-url-mixup In my project, i have 2 model. family and schedule As i wanted to have 1 api to get all while the other is to get current user only therefore

Django 2.0 throws AttributeError: ''Image' object has no attribute 'replace'"

2018-01-04 Thread Ari Kanevsky
https://stackoverflow.com/questions/48106161/django-2-0-throws-attributeerror-image-object-has-no-attribute-replace -- 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

How to make a place where you could type in data(number)?

2018-01-04 Thread June Kim
I'm looking for a way to set up a place(square box) where you could input data(number) on a website. and those data would be saved in somewhere else as an excel sheet (.csv) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from t

How to set up polls/admin url in Django Tutorial pt 2

2018-01-04 Thread Luna Tuna
Here's the tutorial . It doesn't seem to mention after editing polls/admin.py how you set up the urls. So I'm getting page not found when I goto http://127.0.0.1:8000/polls/admin My polls index page works and displays the hello world t

Send Activation code in the email

2018-01-04 Thread Slc Rockers
as we see in some website ..when we register it sends activation code of 5/6 alphanumeric character and when we enter the code our accounts get activated... i am using "Djoser" with "django-rest-framework".. and djoser sends activation url for activation...what should i do for activation code ra

Re: How to get ModelAdmin given a Model

2018-01-04 Thread Edouard C.
'type(v)' is model..instead of 'v is model' works, in case not too late for someone else... thanks Matt.. def get_admin(model): for k,v in admin.site._registry.iteritems(): if type(v) is model: return v On Monday, January 11, 2010 at 9:37:47 PM UTC, Matt Schinckel wrote

Re: Split API URLs to second project/settings/wsgi ?

2018-01-04 Thread guettli
Am Mittwoch, 3. Januar 2018 17:40:51 UTC+1 schrieb Jason: > > Sounds like this is a good use case to integrate DRF to solve multiple > problems. > > > I am unsure. I would like to have auth solved by the framework. With framework I mean django. -- You received this message because you are sub

Re: Scope of Django

2018-01-04 Thread Julio Biason
Hi Sidharth, What do you mean by "scope"? Django is the backend and templating engine (in the backend, not frontend like React/Vue/Preact). You can basically write the whole "store data" part in Django, with the presentation on top of it and add some interaction with the user with JavaScript (manu

Re: Django Admin Form clean method override only working for one exception

2018-01-04 Thread Julio Biason
Hi Dean, You forgot to call the form clean method (the first line after your `def clean` should be `super().clean()` as shown in the documentation: https://docs.djangoproject.com/en/2.0/ref/forms/validation/#cleaning-and-validating-fields-that-depend-on-each-other ). On Thu, Jan 4, 2018 at 7:06 A

Scope of Django

2018-01-04 Thread Sidharth Rai
Hello, What is the scope of Django over JavaScript? Can anyone suggest me some good online tutorials for Django for building web apps? Thank You. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receivi

Django Admin Form clean method override only working for one exception

2018-01-04 Thread dean raemaekers
Hello, I am trying to override the Forms in the Django Admin interface to have custom exceptions in the clean() method. This works for my first validation, but it doesn't work for a second one in the same form, or on another form at all. I am wondering if I have the syntax wrong for multiple v

Re: Django storing byte string for image

2018-01-04 Thread Shem Ogumbe
Maybe try the conversion then save the path to MongoDb, but not the bytsetring itself On Wednesday, January 3, 2018 at 3:03:36 PM UTC+3, chern...@gmail.com wrote: > > What field should i use to store byte string so that i can later use it > for ByteIO to convert it into image ? > > As this is my

Re: How to delete all the objects which are referring the current object without DELETE_CASCADE

2018-01-04 Thread James Schneider
On Jan 3, 2018 4:29 AM, "Jani Tiainen" wrote: Hi, As I posted on other thread you can do that using meta api. But why you want to do that manually. DELETE_CASCADE does the same thing exactly. While I don't know the motivations of the OP, one reason you may want to do this is for auditing pur

Re: How to delete all the objects which are referring the current object without DELETE_CASCADE

2018-01-04 Thread Shem Ogumbe
Question is, why do that when on_delete=models.CASACADE is there to do it for you? On Wednesday, January 3, 2018 at 3:03:36 PM UTC+3, mohitdu...@gmail.com wrote: > > How to delete all the objects which are referring the current object > without DELETE_CASCADE > -- You received this message

Re: Django storing byte string for image

2018-01-04 Thread cherngyorng
> > From the requirement i get, i am suppose to store the bytestring into another > db. Main db is using postgresql, the image however is save to path into > mongodb. > > and yes, the image im recieving is in byte string. Thank you guys for your help ! I'm going to try it out locally first --

Re: Django storing byte string for image

2018-01-04 Thread Shem Geek
On Wednesday, January 3, 2018 at 3:03:36 PM UTC+3, chern...@gmail.com wrote: > > What field should i use to store byte string so that i can later use it > for ByteIO to convert it into image ? > > As this is my first time doing on byte string to image, i am pretty lost > on what i need to do. >