Re: DRF and self join

2015-08-20 Thread James Schneider
Have a look at this SO post that the DRF author responded to for a similar situation. http://stackoverflow.com/questions/13376894/django-rest-framework-nested-self-referential-objects As far as the view, you'll need to be more specific about what you want the view to do. The serializer is

DRF and self join

2015-08-20 Thread Shekar Tippur
Hello, I am looking for a model/serializer/view for a self join. I can have nested paernt child relationship. The one I am trying: model: class ParentChild(models.Model): parent=models.CharField(max_length=100, blank=False, default='', unique =True) child=models.ForeignKey('self',

Re: Feature Suggestion: New Setting called LOGOUT_REDIRECT_URL

2015-08-20 Thread Tim Graham
In fact, there is an accepted ticket which suggests the same: https://code.djangoproject.com/ticket/12405 Feel free to try your hand at a patch if you like! On Thursday, August 20, 2015 at 4:41:05 PM UTC-4, Robert Roskam wrote: > > Basically, the same feature set as here: >

Re: Using ModelForms

2015-08-20 Thread Hugo Kitano
Could you elaborate on my form has some error? On Thursday, August 20, 2015 at 1:43:32 PM UTC-7, Edgar Gabaldi wrote: > > The code seems right. Probably your form has some error. Try print > {{form.errors}} in your template to check. > > On Thu, Aug 20, 2015 at 4:45 PM, Hugo Kitano

Re: Time Zone Problem when following on tutorial

2015-08-20 Thread Palmillo
Many thanks too all!! You've been really helpful On Monday, June 23, 2014 at 7:34:03 PM UTC-3, Jerry Wu wrote: > > Dear every one, > > I am following the tutorial > and meet with > some problem with Time Zone part. Since I am in

Re: Using ModelForms

2015-08-20 Thread Edgar Gabaldi
The code seems right. Probably your form has some error. Try print {{form.errors}} in your template to check. On Thu, Aug 20, 2015 at 4:45 PM, Hugo Kitano wrote: > Hi, I'm a beginner using Django, and I'm having trouble using model forms > to create instances of my model. >

Feature Suggestion: New Setting called LOGOUT_REDIRECT_URL

2015-08-20 Thread Robert Roskam
Basically, the same feature set as here: https://docs.djangoproject.com/en/1.8/ref/settings/#login-redirect-url Modified it below: Default: '/accounts/logout' The URL where requests are redirected after login when the contrib.auth.logout view gets no next parameter. This setting also accepts

Using ModelForms

2015-08-20 Thread Hugo Kitano
Hi, I'm a beginner using Django, and I'm having trouble using model forms to create instances of my model. When a user submits a form, the database saves nothing. Here's my code for the view def submit(request): SubmissionForm = modelform_factory(Submission, fields=('sub_name', 'sub_file'))

Re: How do you access the HTTP data in a view derived from the generic View class?

2015-08-20 Thread Luis Zárate
with request.POST.get("foo", "") or request.POST.getlist("foo", [] ) 2015-08-20 13:58 GMT-06:00 Daniel Grace : > Suppose I have a view as follows: > > from django.views.generic import View > from django.http import HttpResponse > from braces.views import CsrfExemptMixin > >

Re: How do you access the HTTP data in a view derived from the generic View class?

2015-08-20 Thread Daniel Grace
I found the answer to this is to look at request.POST. -- 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

How do you access the HTTP data in a view derived from the generic View class?

2015-08-20 Thread Daniel Grace
Suppose I have a view as follows: from django.views.generic import View from django.http import HttpResponse from braces.views import CsrfExemptMixin class TestView(CsrfExemptMixin, View): def post(self, request, *args, **kwargs): # how to access the HTTP data here? return

Re: MIGRATION_MODULES possible bug.

2015-08-20 Thread b . wade
Thanks Tim, that looks to be the exact situation I am facing. On Thursday, August 20, 2015 at 9:53:03 AM UTC-7, Tim Graham wrote: > > I guess > https://github.com/django/django/commit/b9c619abc101688fbbfa981525175f831d359483 > > might help. > > On Thursday, August 20, 2015 at 10:02:04 AM

WHEN EXISTS Query in SQL to Django Queryset

2015-08-20 Thread Dheerendra Rathor
Hello, I've a complex SQL Query SELECT DISTINCT "event_event"."id", "event_event"."title", "event_event". "description", "event_event"."category", "event_event"."event_time", "event_event"."event_place", "event_event"."time", "event_event"."cancelled" , "event_event"."posted_by_id", CASE WHEN

Re: ATOMIC_REQUESTS Middleware inside Transaction

2015-08-20 Thread Tim Graham
I'm not sure what type of reply or answer you are looking for. Overhauling Django middleware as discussed on the developers mailing list might be best in the long run. https://groups.google.com/d/topic/django-developers/uW5Ogio8QBc/discussion On Thursday, August 20, 2015 at 3:54:20 AM UTC-4,

Re: MIGRATION_MODULES possible bug.

2015-08-20 Thread Tim Graham
I guess https://github.com/django/django/commit/b9c619abc101688fbbfa981525175f831d359483 might help. On Thursday, August 20, 2015 at 10:02:04 AM UTC-4, b.w...@thelinguist.com wrote: > > I believe the cause of this is line 248 in django/db/migrations/writer.py > > create_path =

Re: Time Zone Problem when following on tutorial

2015-08-20 Thread 'Tom Evans' via Django users
On Fri, Jul 4, 2014 at 12:01 AM, Mike Dewhirst wrote: > On 3/07/2014 11:57 PM, Jerry Wu wrote: >> >> Mike, >> >> Sorry for the late reply. >> >> Your explanation about "time is constant" makes sense to me. But I still >> didn't know what to do with time setting following

Re: Time Zone Problem when following on tutorial

2015-08-20 Thread Luis Zárate
install pytz $ pip install pytz In settings USE_TZ = True https://docs.djangoproject.com/en/1.8/topics/i18n/timezones/ And the time_zone is TIME_ZONE = "America/Argentina/Buenos_Aires" More details in

How can I use extra data in Javascript for custom rendering

2015-08-20 Thread Ram Ganesh
Just posted a question about this on stackoverflow -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

Custom page design by users

2015-08-20 Thread Aamu Padi
I am planning on building a blogging site. In that, I would like to allow the users to customize there page using html tags and bootstrap. 1. How do I save the contents? - Save all the contents in the db? - Or create different html files and serve them? -

Re: Time Zone Problem when following on tutorial

2015-08-20 Thread Palmillo
Hi, sorry to bring this up again, but I am currently facing same issue here: following the tutorial (first time with both Django and Python). I live in Buenos Aires, Argentina (UTC-3). Therefore, I would like to set the time zone for this region. I apologize, but although I serfed the web

Django Live Site to Localhost (Testing)

2015-08-20 Thread bhanu
We have a completely developed Django Site running on live, But it never had a testing environment. Now, I downloaded all the files of Website and download a mysql dump file. I want to run this on my local machine windows (Just to push my changes here to test before going live). I installed

django rest framework with mongoengine login

2015-08-20 Thread Selva sundar raj
currently i am doing application in DRF with mongoengine , in that how to do login with mongoengine user any can help me? -- 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

Re: MIGRATION_MODULES possible bug.

2015-08-20 Thread b . wade
I believe the cause of this is line 248 in django/db/migrations/writer.py create_path = os.path.join(upath(sys.path[0]), *package_dirs) Which is automatically using the first path location in the system path list. Unfortunately with the way our buildout handles paths this is causing a

Re: ATOMIC_REQUESTS Middleware inside Transaction

2015-08-20 Thread guettli
Sad, not reply since nine days ... Is there something you don't understand? Please ask :-) Am Dienstag, 11. August 2015 09:24:37 UTC+2 schrieb guettli: > > I am not happy that settings.ATOMIC_REQUESTS=True isolates only the view, > but not the middlewares > in one transaction. > > For