options

django: How to limit field choices in formset?

不问归期 提交于 2019-11-29 10:39:59
I'm having problems limiting the selectable choices in a formset. I have the following models: Employees, Department, Project, Projecttype, Membership, and Role. An employee can add/remove the roles that they play for a given departments project in the formset, the form should limit the selectable projects to only those belonging to the department that the employee belongs to. MODELS: class Department(models.Model): name = models.CharField(max_length=20) def __unicode__(self): return self.name class Employee(models.Model): fname = models.CharField(max_length=15) department = models.ForeignKey

Setting Default NetBeans Options (-std=c99, -Wall) for C programs

戏子无情 提交于 2019-11-29 09:10:58
I have NetBeans 6.9 installed and working fine on Ubuntu Linux 11.10. My goal is to set compiler options like -Wall and -std=c99 to be used by default. Currently, I have to right click on my project -> Properties -> C Compiler -> Warning Level to " More Warnings " and add -std=c99 to Additional Options . This is obviously a pain when creating many projects, and I'm sure there is a way to make all of this the default . I found this thread which relates closely to my question. However, the only answer involves installing Code::Blocks and MSYS 1.0.11, which doesn't make much sense to me. I don't

Options-enabled content-script Chrome extension without background page?

非 Y 不嫁゛ 提交于 2019-11-29 08:18:13
I'm making a content script extension for Google Chrome, it adds functionality to a website's page. I want to add a couple of options, not big deal really, I'd just need two strings (none of which are sensitive user data). From this answer , I assume I need a background page, which I'd rather not add to my extension - I don't want it to gain unnecessary weight. Do I really need a background page, or I could have an options page without it (and which storage could I use)? UPDATE As of Chrome 20 you can now use the Storage api..... http://code.google.com/chrome/extensions/storage.html Old way

extend jquery ui dialog (add more options)

。_饼干妹妹 提交于 2019-11-29 05:15:38
how I can create and add new options for jQuery dialog? for example: I like that through on the setting options can control the display of title bar or display the close button. The script would be like this: $("#message").dialog({ showTitle:false, //new option (hide Title bar) showCloseButton:true //new option (show close button) modal:true... //other options }) It's a little easier than I expressed in my comment. // store old method for later use var oldcr = $.ui.dialog.prototype._create; // add the two new options with default values $.ui.dialog.prototype.options.showTitlebar = true; $.ui

Best practices for handling user preferences in an iPhone MVC app?

假装没事ソ 提交于 2019-11-29 05:15:18
I'm developing my first iPhone app, and while implementing user preferences, I have a few questions on how to best implement this. Assume the basic MVC pattern: MainView displaying data stored in a Model object; MainViewController handling the app logic. For the options, I have an OptionsView and an OptionsViewController. A RootViewController handles swapping of the Main and Options views. First of all, what about the options data? Would I want to make an NSOjbect-derived class to store them (an OptionsModel)? Or maybe a simple NSDictionary would suffice? Second, who owns the options data?

jQuery plugin - update settings after initialization

谁说我不能喝 提交于 2019-11-29 04:49:10
I have a jQuery plugin, and I want to be able to change options on the fly, like this example: $('.element').pwstabs('options','effect',scale) or something simular to it. I tried adding update: function , tried adding Plugin.prototype.update , but still cant figure out how to do that :) Here's the structure of the plugin: ;(function ($, window, document, undefined) { var pluginName = "pwstabs", defaults = { effect: 'scaleout', defaultTab: 1, containerWidth: '100%', tabsPosition: 'horizontal', horizontalPosition: 'top', verticalPosition: 'left', responsive: false, theme: '', rtl: false,

How can I change the Options menu background for Android 2.3?

倖福魔咒の 提交于 2019-11-28 23:51:40
I have the same standard options menu, but I want to change the background of the items from white to black. I've seen many postings about how to do it, but those don't work for 2.3. Does anyone know of a working menu inflater with a custom-colored background compatible with version 2.3? **ATTENTION* * NO IMAGE PLACEMENT!!! NO CODE FROM OTHER POSTINGS, BECAUSE IVE TRIED THEM ALL HERE!!! In an ideal scenario, you shouldn't be doing that. Various devices would have different colors, as they decide. If you really really have to customize the menu item's backgrounds, then, I would suggest don't

Filter duplicate options from select dropdown

我与影子孤独终老i 提交于 2019-11-28 23:37:47
I have a dropdown selector generated from a list and want to filter the options to remove the duplicate entries. e.g. I want to filter ... <select name="company"> <option "1">Microsoft</option> <option "2">Microsoft</option> <option "3">Microsoft</option> <option "4">Microsoft</option> <option "5">Apple</option> <option "6">Apple</option> <option "7">Google</option> </select> ... down to present the user with something like... <select name="company"> <option "1">Microsoft</option> <option "5">Apple</option> <option "7">Google</option> </select> (The data comes from a Sharepoint Lookup on

How to change Options menu dots color? [duplicate]

血红的双手。 提交于 2019-11-28 20:07:19
This question already has an answer here: Change color of the overflow button on ActionBar 12 answers I want to change Options menu's dots color to white. I tried to add image for this but dose not work. How to do this? menu xml : <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context="com.example.siddhi.timetablelayout.Main2Activity"> <item android:id="@+id/action_settings" android:title="@string/action_settings" android:orderInCategory="100" app:showAsAction="never"

AngularJS directive with default options

混江龙づ霸主 提交于 2019-11-28 15:26:21
I'm just starting with angularjs, and am working on converting a few old JQuery plugins to Angular directives. I'd like to define a set of default options for my (element) directive, which can be overridden by specifying the option value in an attribute. I've had a look around for the way others have done this, and in the angular-ui library the ui.bootstrap.pagination seems to do something similar. First all default options are defined in a constant object: .constant('paginationConfig', { itemsPerPage: 10, boundaryLinks: false, ... }) Then a getAttributeValue utility function is attached to