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...
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
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
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'
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
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
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_
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
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
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
(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
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
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
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
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
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
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
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.
--
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 <
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?
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
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
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
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
24 matches
Mail list logo