Django Serialization: ManyToMany Field doesn't input into database

2022-04-12 Thread Jeffrey Ma
The code runs and all fields except the manytomany field is written into the mysql database. I am posting json to the django backend which will be written into the database. For more information: https://stackoverflow.com/questions/71849923/django-serializer-inserting-nothing-into-database-no-er

I hope to increase OneToOne mode GenericForeignKey

2018-02-05 Thread Ma Mars
I hope to increase OneToOne mode GenericForeignKey, For example, a passport (one user has only one passport, but there are many user roles, such as staff, drivers, customers, but they are one to one) -- You received this message because you are subscribed to the Google Groups "Django users" gro

Re: Dos Modelos en un formulario django

2017-07-31 Thread angel . gabriel . ma
Hola que tal. Si es posible. Checa este video : https://codigofacilito.com/videos/18-curso-django-crud-con-dos-formularios-parte-2 Creo que es lo que buscas. Saludos. On Thursday, July 27, 2017 at 5:38:43 PM UTC-5, Nelson Fernando Garcia Gomez wrote: > > hola Buenas soy algo nuevo en django

Re: How can I create models which only required during tests in Django 1.7c1?

2014-08-29 Thread Yo-Yo Ma
8d0cd8ffc78b531 (get_model(, ) was messier, due to the need for exception handling). On Friday, August 29, 2014 10:57:05 AM UTC-4, Alex Chiaranda wrote: > > Hi, can't you guys mock these models ? > > On Thursday, August 28, 2014 9:31:04 PM UTC-3, Yo-Yo Ma wrote: >> >> Ugh...

Re: How can I create models which only required during tests in Django 1.7c1?

2014-08-28 Thread Yo-Yo Ma
Ugh... same problem here. It seems you can't really create a model in setUp anymore. I'll post a reply, if I find anything. On Wednesday, July 16, 2014 10:17:56 AM UTC-4, Alisue Lambda wrote: > > Hi all. > > Well today I tried Django 1.7c1 with my program and found that the > previous testing s

HttpResponseRedirect vs render_to_response

2014-05-18 Thread Colin Ma
Hello, I know there are a bunch of threads on this topic (on stacked overflow at least), but I am having trouble understanding something. In this post: http://stackoverflow.com/questions/1921523/django-what-is-the-difference-b-w-httpresponse-vs-httpresponseredirect-vs-rende -- the accepted

Re: Pattern for Ajax Forms using Django ModelForm and Class Based Views.

2013-02-09 Thread Yo-Yo Ma
I might be worth checking out some sort of API library, like https://github.com/orokusaki/django-jsonrpc-2-0, which will allow you to perform whatever business logic you need to, and then simply return something like {"success": True, "errors": errors_list} - your templates and ordinary views c

Internationalization: trans with object property

2012-10-24 Thread Ma Ba
Hi, I have a question about the internationalization feature ... I have a country model: class Country(models.Model): nameKey = models.CharField(max_length=50) shortNameKey = models.CharField(max_length=30) The properties 'nameKey' and 'shortNameKey' contain resource keys like '_country

Re: Does ``QuerySet.select_for_update`` lock related (joined) rows as well?

2012-09-05 Thread Yo-Yo Ma
Thanks, Tom. That does help. On Wednesday, September 5, 2012 6:02:27 AM UTC-4, Tom Evans wrote: > > On Wed, Sep 5, 2012 at 1:45 AM, Yo-Yo Ma > > wrote: > > restaurant = > > > Restaurant.objects.select_for_update().select_related('owner').get(name=u'

Does ``QuerySet.select_for_update`` lock related (joined) rows as well?

2012-09-04 Thread Yo-Yo Ma
restaurant = Restaurant.objects.select_for_update().select_related('owner').get(name=u'Koala Kafe') Assuming the ``owner`` field points to a ``Person`` table, will the aforementioned query prevent the ``Person`` row returned for the Koala Kafe's owner from being saved in a separate transaction

What happens when you use ``select_for_update`` with ``select_related``?

2012-08-19 Thread Yo-Yo Ma
Given a model ``Employee`` with a foreign key ``company`` pointing to a model called ``Company``, would the following example lock both the ``Employee`` and ``Company`` rows that were selected? employee = Employee.objects.select_for_update().select_related('company').get(pk=1) Or, would only t

AutoField field that increments with regards to a foreign key?

2010-10-21 Thread Yo-Yo Ma
Example: Company has many Tickets Tickets have a PK, as well as a "number". Each Ticket's "number" should be the highest prior "number" for a Ticket with the same Company Ticket: pk: 1, number: 1, company: XYZ Ticket: pk: 2, number: 1, company: Acme Ticket: pk: 1, number: 2, company: XYZ unique_

Re: Something breaking if tag

2010-09-29 Thread Yo-Yo Ma
request.GET.get('subtopic') is returning a string, so your if statement is roughly equivalent to: >>> 1 == '1' False The sub_topic = int(request.GET.get('subtopic')) is the correct way to do that. At first glance it seems like a lot of work, but if Django tried to deserialize URL params automatic

Re: What is the correct way to copy an object from one model to a similar model?

2010-09-29 Thread Yo-Yo Ma
Thanks guys. I appreciate the help. On Sep 29, 6:43 am, bruno desthuilliers wrote: > On 29 sep, 12:31, Steve Holden wrote: > > > On 9/29/2010 5:25 AM, Daniel Roseman wrote: > > > You can use the get_all_field_names method in model._meta to get all > > > the actual fields, and set them on the dup

Re: Import Error

2010-09-28 Thread Yo-Yo Ma
   csrf_token template tag, as well as those that accept the POST data. > > You're seeing the help section of this page because you have DEBUG = True in > your Django settings file. Change that to False, and only the initial error > message will be displayed. > > You can cust

Re: Import Error

2010-09-28 Thread Yo-Yo Ma
(r'^login/', include('macrohms.views.login')), is incorrect. the include() function, pertaining to urls.py is for including other URL confs (so you can have sub-sections of your site contain their own urls.py). You'll want to replace that line with: url(r'^login/$', 'macrohms.views.login')), No

What is the correct way to copy an object from one model to a similar model?

2010-09-28 Thread Yo-Yo Ma
I have two models that are identical in structure except one has 2 extra fields. The second one is used for record keeping and is never edited by users. The system takes the first model and copies it to the second model, adding some extra meta information, all when a certain action is performed aga

Re: How do you set choices in your application?

2010-09-24 Thread Yo-Yo Ma
Anyone have any thoughts. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more opti

How do you set choices in your application?

2010-09-24 Thread Yo-Yo Ma
Let's say I have a model with a field called "status". I could set the choices in three ways: 1) status_choices = ((1, 'Completed'), (2, 'Unfinished'), (3, 'Cancelled')) 2) status_choices = (('COM', 'Completed'), ('UNF', 'Unfinished'), ('CAN', 'Cancelled')) Or, 3 ): db_choices = Choice.obj

Re: Why Django Apps Suck

2010-09-23 Thread Yo-Yo Ma
Hey Russell, Do you think a round table discussion in a real person context with whiteboards and the best of the bunch (ie, at Django con or similar event) would be a good time/place to re architecture of the abstraction layers, perhaps to address some of the concerns brought up in the slide show

Re: Problem with ForeignKey()

2010-09-22 Thread Yo-Yo Ma
Any thoughts on this? On Sep 22, 10:47 am, Yo-Yo Ma wrote: > Anyone know how to do this? > > On Sep 21, 10:35 pm, Yo-Yo Ma wrote: > > > > > I have a model with: > > > parent = ForeignKey('self', blank=True, null=True) > > > In that model I&#x

Re: Problem with ForeignKey()

2010-09-22 Thread Yo-Yo Ma
Anyone know how to do this? On Sep 21, 10:35 pm, Yo-Yo Ma wrote: > I have a model with: > > parent = ForeignKey('self', blank=True, null=True) > > In that model I've overridden clean() to contain: > > if self.parent: >     # Do some stuff > > It ra

Problem with ForeignKey()

2010-09-21 Thread Yo-Yo Ma
I have a model with: parent = ForeignKey('self', blank=True, null=True) In that model I've overridden clean() to contain: if self.parent: # Do some stuff It raises an attribute error saying that parent.pk doesn't exist. How can I get around this. Note that my foreign key is recursive. --

Re: Django Chat App?

2010-09-16 Thread Yo-Yo Ma
This might not be any help since I know nothing of VOIP, but for the chat portion take a look in to Ape ( a comet server written in C ). On Sep 16, 9:41 am, Sithembewena Lloyd Dube wrote: > Indeed it is, but the media server isn't :). > > On Thu, Sep 16, 2010 at 5:35 PM, esatterwh...@wi.rr.com <

Re: How to pass in a file to a model directly

2010-09-15 Thread Yo-Yo Ma
Anyone? On Sep 15, 1:18 pm, Yo-Yo Ma wrote: > I'm wondering how to do this: > > instance = SomeModelWithFile.objects.create( >     file = some_file, >     spam="Spam", >     foo="Foo" > ) > > How can I manually pass in a file like this?

How to pass in a file to a model directly

2010-09-15 Thread Yo-Yo Ma
I'm wondering how to do this: instance = SomeModelWithFile.objects.create( file = some_file, spam="Spam", foo="Foo" ) How can I manually pass in a file like this? In file=some_file should some_file be a FileUpload instance? How do I create one of those? -- You received this mes

Django Nav - is there anything similar that is actively maintained

2010-08-26 Thread Yo-Yo Ma
I haven't tried http://code.google.com/p/django-nav/ but I would imagine that it probably has issues because it hasn't changed since 2007. Does anyone know if there is a very intuitive navigation helper like this, but newer? -- You received this message because you are subscribed to the Google Gr

Building a generic list template - where should I start?

2010-08-25 Thread Yo-Yo Ma
I'm wanting to build out a list template that can display any list of objects in this manor (pseudo code: {% for thing in things %} {{ thing.foo }} {{ thing.bar }} {{ thing.spam }} {{ thing.eggs }} {% endfor %} The problem is, of course, that I want to list more than just "thing

Re: Selling Django

2010-06-17 Thread Yo-Yo Ma
This thread shows a very prevalent side of most developers that makes me ashamed to tell people that I'm a developer. The OP is not saying that we should go out and advertise that Django is a great CMS. In fact he spends half of his post making trying to preemptively shut all the know-it-all folks

Re: field mapping to multiple columns?

2009-10-07 Thread J. Hall of Carlisle MA
You bring up a very interesting question It seems to make little sense to put this kind of data into a table of it's own. The ORM usually maps a class to a table. in this case you want to map the class to a group of columns in a single table. How do you use a class based compound data type and s

Re: Editors of choice

2009-09-11 Thread ma siqi
ulipad !! 2009/9/7 Samuel Hopkins > Hello Django peeps, > > I am a Django newbee. I have had my eye on Djanjo for a year or so now but > held off because I had limited python experience. However, after a summer of > python and watching Django's popularity snowball, I think I am ready to go > :)

Django vs. WObject...

2009-01-06 Thread MA
Hi, Since our management team is trying to select the platform for further development, I'm in process to prepare the case ( presentation) Django vs. WObject(s). Though both frameworks seems to be very similar in the goals, they are obviously quite different in their internals. I'm wondering

Does the development enterprise application have the available third party report library

2008-11-13 Thread vance ma
Does the development enterprise application have the available report library? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com T

Re: About running django 1.0 and MySQL

2008-10-23 Thread Ma Kwong Chia
Thank you! On Thu, Oct 23, 2008 at 2:21 PM, web_geek <[EMAIL PROTECTED]> wrote: > hi, > > I'm running Django-1.0-1.el5 and mysql-5.0.45-7.el5 on a Red Hat > Enterprise Linux 5.2 box. Some how I still confuse what must be done > to set up Django to talk to MySQL. May I ask for your advice about >

can't compare datetime.datetime to datetime.date

2008-05-20 Thread vance ma
In django ;How to compare datetime.datetime and datetime.date --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe fro

How to add checkbox in admin change_list

2008-03-09 Thread ma chichu
I need to add some checkboxes to filter the change-list in django admin. I extend "admin/change_list.html" in order to avoid write codes myself. Please give me some simple way to achieve that. --~--~-~--~~~---~--~~ You received this message because you are subscribe

Which ajax framework django will support in the upcoming 1.0, prototype/dojo/jquery?

2007-04-10 Thread erdong ma
I do not know if a decision has been made on the ajax framework in 1.0. Anyone knows some message about this. By the way, how about the Eclipse + pydev comparing with the Wing IDE? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Re: pure-HTTP deployment?

2006-12-20 Thread Peter Ma
what's the pure-HTTP deployment mean??? On 12/21/06, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: On 12/20/06 10:46 PM, Jeremy Dunck wrote: > http://us.pycon.org/TX2007/TutorialsPM#PM1 Oh, God -- who the hell put *that* picture there? I have got to change that... Jacob > -- [EMAIL PROTE

Re: I am really new, but I found a few problems using it, or am I wrong?

2006-11-05 Thread Peter Ma
you need the python with data module. On 11/6/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Thanks James, > > I figured it out after a while, but it seems not to be a good idea to > install development version. I did that and made a mess of my computer. > I guess there is a version catch u

Re: Changing Sites Framework

2006-06-18 Thread Peter Ma
what are you want to say? On 6/18/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hello, > I am working on a cms that would involve several sites. I am wanting > to filter several things by site, but the domain names are sometimes > too long and run off the side of the filter box. I was wo

Re: Django without database

2006-05-12 Thread Peter Ma
I think django has automatic CRUD method to any DB object, So, without DB maybe so diffcult on It's archieve . On 5/12/06, Peter Ma <[EMAIL PROTECTED]> wrote: > can Django's database-roadmap add XML or CSV ./etc > > On 5/12/06, Vladimir Pouzanov <[EMAIL PROTECTED]

Re: Django without database

2006-05-12 Thread Peter Ma
can Django's database-roadmap add XML or CSV ./etc On 5/12/06, Vladimir Pouzanov <[EMAIL PROTECTED]> wrote: > > You can use sqlite, fast and easy db interface. > > On 5/12/06, Anja <[EMAIL PROTECTED]> wrote: > > > > Hi, > > we are thinking about creating a small application with Django and > > de

Re: Apache2 mod_python VirtualHost configuration

2006-01-16 Thread Peter Ma
expect solutionthe same question 2006/1/17, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: Actually, I had messed up my DocumentRoot and /etc/host file which waspointiong to my PHP projects path. The Welcome screen was from symfony framework, which I had installed previously.Now, after I fixed it, I'm gett

Re: Django, mod_python error

2006-01-15 Thread peter ma
The same question I meet, not resolve yet

unable to open /usr/lib/python2.4/config/Makefile (No such file or directory)

2005-12-09 Thread peter ma
OS is debian SID error: invalid Python installation: unable to open /usr/lib/python2.4/config/Makefile (No such file or directory)