|
I have done a ModelForm adding some extra fields that are not in the model. I use these fields for some calcualtions when saving the form. The extra fields appear on the form and they are sent in the POST request when uploading the form. The problem is...
Started by Antonio Melé on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
That's weird because normal fields() it doesn't raise ....
It seems that accessing the extra fields with cleaned_data['field_name'] raises a KeyError but using cleaned_data.get('field_name') works.
Ok I have resolved it.
|
|
I have IIS log with extra field 'foo'.
#Fields: foo date s-sitename ... foo1 2009-02-15 W3SVC1 ... foo2 2009-02-15 W3SVC1 ...
As result all LogParser queries are broken:
logparser -i:IISW3C "SELECT c-ip, s-ip FROM my.log" Statistics: Elements processed...
Started by alex2k8 on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Logparser -h will prove additional inforamtion.
Activity, you might want to consider using a standard format, or at least moving the extra field to define your own fields.
|
|
While subclassing db.models.Model, sometimes it's essential to add extra checks/constraints. E.g. I have an Event model with start_date and end_date. I want to add validation into the fields or the model so that end_date > start_date. How many possible...
Started by Viet on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Do it inside your save method of your model:
def save(self): if(self.end_date > self.start_date): super(Foo, self).save() else: raise Exception, "end_date should be greater than start_date"
I would not put constraints like these in the save method... .
|
Ask your Facebook Friends
|
I have a form being inserted into a page with jQuery. In all other browsers, it submits correctly... but in Chrome, some extra form fields from other forms on the page are being added to the POST. I'm not using javascript to submit the form, the form ...
Started by Ben on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
If this works in other....
If the form is nested within another form, this could trigger the browser in being unable to work out which form and its values you want to send and will try and do its best to send whatever values it thinks belongs to the form .
|
|
I trying to create an HTML/CSS/JavaScript based list manager.
I'm using text input fields as my individual list items, with the first text input field being:
<input type="text" id="input1" value="Enter your first item" />
I'm using jQuery to create...
Started by Russell on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
It executes an action at most one time, so you can attach it to each input field.
Syntax.
|
|
I would like to store my personal data in a FOAF file on my own server. There is a group of us doing the same thing. We need a couple of custom fields that the standard FOAF implementation doesn't have, ie: availability.
How can I add the availability...
Started by skymook on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
You could just make up a namespace and use it:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:myvocab="http://my.example.org... .
It's really simple, you just need an 'availability' property.
|
|
When using the SQL MIN() function, along with GROUP BY, will any additional columns (not the MIN column, or one of the GROUP BY columns) match the data in the matching MIN row?
For example, given a table with department names, employee names, and salary...
Started by Tim Lytle on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
SELECT e.* FROM employee e WHERE e.id = ( SELECT id FROM employee ei WHERE ei.department = 'sales' ORDER BY e.salary LIMIT 1 )
To get values for each department, use:
SELECT e.* FROM department d LEFT JOIN employee e ON e.id = ( SELECT id FROM employee... .
|
|
I'm using the America/New York timezone. In the Fall we "fall back" an hour -- effectively "gaining" one hour at 2am. At the transition point the following happens:
it's 01:59:00 -04:00
then 1 minute later it becomes:
01:00:00 -05:00
So if you simply ...
Started by Aaron on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
TIMESTAMP....
Contrary to what I said in one of my previous comments, DATETIME and TIMESTAMP fields do behave differently.
That's always as anything else).
('2009-11-29 01:30:00','-04:00','+00:00');
Even better, save the dates as a TIMESTAMP field.
|
|
Hello there,
I am so happy with qTranslate but i am having hard time using it with custom fields aka extra fields.
When i try to write the content with both quicktag options it doesn't recognizes.
[:en]test[:tr]deneme prints as it is.
is it only me having...
Started by liger
Member on
, 4 posts
by 3 people.
Answer Snippets (Read the full thread at wordpress):
This is on the dev's forum: http://www.qianqin.de/qtranslate/forum.
For custom registration fields.
|
|
I'm trying to write a named scope that will order my 'Products' class based on the average 'Review' value. The basic model looks like this
Product < ActiveRecord::Base has_many :reviews Review < ActiveRecord::Base belongs_to :product # integer value...
Started by Kerinin on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
That makes it available not a Rails developer, but I know SQL allows you to sort by a field that is not in the select-list.
If there are better approaches):
I moved the score field into the inner join.
|