field

Get Model Field Name in Template

In a template for a view I would like to use the name of a field and not just the value. So for example if I have this: class Test(models.Model): name = models.CharField(max_length=2, verbose_name = 'Your name') age = models.PositiveSmallIntegerField(max_length=3) I would like to be able to do {{ name.get_field_name_display }} which...

Literal field value for Solr CSV

Is there a way to provide a literal field value when adding a CSV document? The documents do not contain a necessary field, so I need a way to specify the value some other way. I've tried things like f.field.map=:VALUE to no avail. Setting a default value for the missing field in schema.xml works, but it's obviously not a practical so...

How can I store an array of boolean values in a MySql database?

In my case, every "item" either has a property , or not. The properties can be some hundreds, so I will need , say, max 1000 true/false bits per item. Is there a way to store those bits in one field of the item ? ...

How many formats of x.509 client certificate file are there?

I am working on a task which is to get the client certificate when the user sends a request to the server. I have to get the certificate and get the 3 pieces of information from the certificate: user name, user's email address and user's firm name. At first it seems quite simple to just get the "Subject CN" for user name, "Subject E" fo...

django unique field

is there another REGEX way (or another way) to ensure that a model class field would be unique? (it is not a key, or at least not declared as a key, is shoulb be a simple CharField) Thanks ...

SharePoint Custom Field - is it possible to handle item deletion event?

I'm expanding SPFieldText and BaseFieldControl to create a custom field. The field saves some data externally (for example, on a database or on another list) Within the control I'm able to handle Edit and New events (using ControlMode). I'd like to run a function and clean up some data when an item containing my field is deleted. Is t...

UML class diagram: to add fields used to implement relationships or not?

Hi all, I am trying to figure out if it is correct to put in the fields of the particular class a reference to an object/collection that this class is related with. Let's say I have a class University that aggregates many instances of Student class. When I put on my diagram both classes, I add the relationship of aggregation between th...

Public Property Definition

Hi guys, What are the benefits of defining a property for a object instead of giving direct access to the private variable? Instead of : public class A private _x as integer = 0 Public property X() as integer Get return _x End Get Set(ByVal value As integer) _x = value ...

Team's work item: what is the straight way for restricting query just to one folder in the project?

Hello. i want to filter the Work-items for viewing just work-items related to one folder of the project. is there any field that will help me? System.TeamProject is just to project name, not subfolders? Thanks. ...

Initialize a django.forms.ModelChoiceField, binded with foreign key, with default value

I have a model that contains a foreign key value, then in the form generated from this model as a ModelChoiceField. I want to auto select the user's (update_author). I've tried the below code, using the initial property. The view creates a formset with the the dates initialized to now() for the empty form. But, I want also the update_au...

Ms-Access: any need to have a low size for variable-length text fields

In an Ms-Access MDB, will it save disk space to limit the size of variable-length text fields? eg. If I have a variable-length Text field of size 20 and all the actual values of the field are under 10 characters, am I wasting space? Would it be better to set the size of the field to 10, or does it not make any difference? ...

scanf / field lengths : using a variable / macro, C/C++

How can I use a variable to specify the field length when using scanf. For example: char word[20+1]; scanf(file, "%20s", word); Also, is it correct to use 20+1 (since it needs to add a \0 at the end?). Instead, I'd like to have something like: #define MAX_STRING_LENGTH 20 and then char word[MAX_STRING_LENGTH+1]; scanf(file, "%"MAX...

Best Aproach to Relate A Entity Class to the Correspoding Table in a DataBase

i want to relate each Field of an Entity Class to the corresponding datatable Field. im working on c# currently Any Suggestions? ...

Display a message inside Android Edit Text Field

Hai, I have an Android Program with one text field. I need to display a message inside that textfield when it loads on an emulator. When the user clicks inside that textbox that message should dispappear. For Ex: Please enter name Can any one post some sample code over here... ...

hook_user(): inserting extra field into database not just form.

I can add an extra field to the registration. What I need to know is what step do I need to take to then grab that input and insert it into the user table of drupal. The code below is in my module this adds just a field to the form, but when its submitted it doesnt do anything with the data. function perscriptions_user($op, &$edit, &$ac...

passing an input field value through a querystring using jquery

I trying to store the value of the input field tbEmail into str so when the user clicks the submit button the value of tbEmail will be added to the querystring. If i change this so that it reads var str = "this"; then this works. Is this the incorrect way to get an iput field value in jquery? Any ideas? <script type="text/javascript"> ...

Field is not updated on the client-side after server updating.

Markup: <asp:UpdatePanel ID="detailsUpdatePanel" runat="server" > <ContentTemplate> <asp:HiddenField ID="detailsPopupOpening" runat="server" Value="false" /> <ajax:AsyncFileUpload runat="server" ID="upload" OnUploadedComplete="OnUploadComplete" /> <asp:Button ID="buttonSave" runat="server" OnClick="OnUpdate" UseSubmitBehavio...

Modifying Drupal Form Fields - [#weight] in array not being respected?

Hello all, I don't have experience in php. I've followed a few tutorials to modify my Drupal forms using the theme method in template.php. For some reason the [#weight] property for a field does not adhere to its values. I'd like to move the Category field [cid] above Subject field [subject]. These are the lines of code I used: $form[...

Copy my addresses in different fields in javascript

Hello, i have in my jsp different addresses, I can choose to copy to my fields. I wanted to know if anyone has sample code in javascript to provide me, thank you. http://www.freeimagehosting.net/image.php?87514f7c3e.jpg Different editable fields . A list of address, when I select an address, I want to automatically informs my fields ...

get a date out of lucene

Hi, I have indexed a date in lucene using DateTools.dateToString to store the date in a particular field. Is there any way to know if this was a date field, and more importantly how to get the date out again? It's a fieldable with a long integer value. Thanks ...