Search Results

Search found 10804 results on 433 pages for 'attribute keys'.

Page 42/433 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • factory girl - know when an attribute is overridden in factory

    - by carlos
    Is there any way to determine if attributes are overridden in a factory and adjust the behavior of the factory based on those overrides? The evaluator passed into the callbacks contains a __override_names__ method. Unfortunately, by the time it is passed to the callback, every attribute configured by the factory is included in the array returned. Moreover, the Evaluator is marked as api private.

    Read the article

  • Upgrading Entity Framework 1.0 to 4.0 to include foreign keys

    - by duthiega
    Currently I've been working with Entity Framework 1.0 which is located under a service façade. Below is one of the save methods I've created to either update or insert the device in question. This currently works but, I can't help feel that its a bit of a hack having to set the referenced properties to null then re-attach them just to get an insert to work. The changedDevice already holds these values, so why do I need to assign them again. So, I thought I'll update the model to EF4. That way I can just directly access the foreign keys. However, on doing this I've found that there doesn't seem to be an easy way to add the foreign keys except by removing the entity from the diagram and re-adding it. I don't want to do this as I've already been through all the entity properties renaming them from the DB column names. Can anyone help? /// <summary> /// Saves the non network device. /// </summary> /// <param name="nonNetworkDeviceDto">The non network device dto.</param> public void SaveNonNetworkDevice(NonNetworkDeviceDto nonNetworkDeviceDto) { using (var context = new AssetNetworkEntities2()) { var changedDevice = TransformationHelper.ConvertNonNetworkDeviceDtoToEntity(nonNetworkDeviceDto); if (!nonNetworkDeviceDto.DeviceId.Equals(-1)) { var originalDevice = context.NonNetworkDevices.Include("Status").Include("NonNetworkType").FirstOrDefault( d => d.DeviceId.Equals(nonNetworkDeviceDto.DeviceId)); context.ApplyAllReferencedPropertyChanges(originalDevice, changedDevice); context.ApplyCurrentValues(originalDevice.EntityKey.EntitySetName, changedDevice); } else { var maxNetworkDevice = context.NonNetworkDevices.OrderBy("it.DeviceId DESC").First(); changedDevice.DeviceId = maxNetworkDevice.DeviceId + 1; var status = changedDevice.Status; var nonNetworkType = changedDevice.NonNetworkType; changedDevice.Status = null; changedDevice.NonNetworkType = null; context.AttachTo("DeviceStatuses", status); if (nonNetworkType != null) { context.AttachTo("NonNetworkTypes", nonNetworkType); } changedDevice.Status = status; changedDevice.NonNetworkType = nonNetworkType; context.AddToNonNetworkDevices(changedDevice); } context.SaveChanges(); } }

    Read the article

  • ASP.NET Checkboxes/RadioLists Arrow Keys

    - by rlb.usa
    I have an ASP.NET web application for data entry, and we have big lists of radiobuttons, and long lists of checkboxes, in some sections. The client wants to be able to be able to navigate and manipulate these controls with their keyboard, like the tab/space/enter/right-left-up-down-arrow-keys. Are there any ASP.NET controls that I can use?

    Read the article

  • preg_match_all to parse an xml-like attribute string

    - by Rob
    I have a string like so: option_alpha="value" option_beta="some other value" option_gamma="X" ...etc. I'm using this to parse them into name & value pairs: preg_match_all("/([a-z0-9_]+)\s*=\s*[\"\'](.+?)[\"\']/is", $var_string, $matches) Which works fine, unless it encounters an empty attribute value: option_alpha="value" option_beta="" option_gamma="X" What have I done wrong in my regex?

    Read the article

  • Localization of attribute values in .NET

    - by Alex Angas
    How can I localize/internationalize attribute values in .NET? My specific example is for ASP.NET web parts such as WebDisplayName, WebDescription, etc. where I inherit from the base class that uses these attributes. Also, is there any difference to doing this with attributes declared in my own classes? Thanks!

    Read the article

  • Get attribute of JQuery ui.draggable

    - by Jon
    Hi Everyone, I'm using JqueryUI for drag and drop on one of my pages and for some reason I can't seem to get an attribute of the ui.draggable object being passed into my droppable drop event. ui.draggable.attr("src") and $(ui.draggable).attr("src") both return undefined, however if I type ui.draggable.html() I will get the html back. Any ideas?

    Read the article

  • Attribute to skip over statement in unit test c#

    - by Eli Perpinyal
    I am looking to skip a certain statement in my unit tests eg: if (MessageBox.Show("Are you sure you want to remove " + contact.CompanyName + " from the contacts?", "Confirm Delete", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) == MessageBoxResult.Yes) is there an attribute i can place above the statement to avoid the unit test executing it?

    Read the article

  • gae error:AttributeError: 'NoneType' object has no attribute 'user_is_member'

    - by zjm1126
    class Thread(db.Model): members = db.StringListProperty() def user_is_member(self, user): return str(user) in self.members and thread = Thread.get(db.Key.from_path('Thread', int(id))) is_member = thread.user_is_member(user) but the error is : Traceback (most recent call last): File "D:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 511, in __call__ handler.get(*groups) File "D:\Program Files\Google\google_appengine\google\appengine\ext\webapp\util.py", line 62, in check_login handler_method(self, *args) File "D:\zjm_code\forum_blog_gae\main.py", line 222, in get is_member = thread.user_is_member(user) AttributeError: 'NoneType' object has no attribute 'user_is_member' why ? thanks

    Read the article

  • C++: Accessing std::map keys and values

    - by Jay
    How do you access an std::vector of the keys or values of an std::map? Thanks. Edit: I would like to access the actual elements, not just copies of their contents. essentially I want a reference, not a copy. This is essentially what I am wanting to do: std::map<std::string, GLuint> textures_map; // fill map glGenTextures( textures_map.size(), &textures_map.access_values_somehow[0] );

    Read the article

  • Event to listen to attribute changes

    - by Luis
    I dont think this is possible but maybe someone knows a way to achieve this. I want to attach an event to an html element to listen to attribute change. So say for instance that I want something to happen when a visibility of a div changes. The reason is that I have no control over the javascript that is switching the visibility, hence the need for an event. Thanks

    Read the article

  • How to assign XML attribute values to drop down list using XSL

    - by Vijay
    Hi, I have a sample xml as; <?xml version="1.0" encoding="iso-8859-9"?> <DropDownControl id="dd1" name="ShowValues" choices="choice1,choice2,choice3,choice4"> </DropDownControl > I need to create a UI representation of this XML using XSL. I want to fill the drop down list with values specified in choices attribute. Does anyone have any idea about this ? Thanks in advance :)

    Read the article

  • can I have an abstract base class with the key attribute being generic

    - by Greg
    Hi, I want to create a re-usable library. I was going to use extension methods however I run into some issues in some cases for the client to have to specify in the calling method the types. QUESTION - If I use an abstract base class as the basis, can I specify an attribute/property in the class to be generic (e.g. the key property might be an 'int' in one case, or a 'string' in another)?

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >