Search Results

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

Page 147/433 | < Previous Page | 143 144 145 146 147 148 149 150 151 152 153 154  | Next Page >

  • Help a Python newbie with a Django model inheritance problem

    - by Joshmaker
    I'm working on my first real Django project after years of PHP programming, and I am running into a problem with my models. First, I noticed that I was copying and pasting code between the models, and being a diligent OO programmer I decided to make a parent class that the other models could inherit from: class Common(model.Model): self.name = models.CharField(max_length=255) date_created = models.DateTimeField(auto_now_add=True) date_modified = models.DateTimeField(auto_now=True) def __unicode__(self): return self.name class Meta: abstract=True So far so good. Now all my other models extend "Common" and have names and dates like I want. However, I have a class for "Categories" were the name has to be unique. I assume there should be a relatively simple way for me to access the name attribute from Common and make it unique. However, the different methods I have tried to use have all failed. For example: class Category(Common): def __init__(self, *args, **kwargs): self.name.unique=True Spits up the error "Caught an exception while rendering: 'Category' object has no attribute 'name' Can someone point me in the right direction?

    Read the article

  • Cannot change borderColor of TD

    - by Tadeus Prastowo
    Using JS to set the background color of a TD is fine. But, setting the border color is problematic in FF 3.0.18 although IE 6 doesn't experience this. FF is problematic in that it requires the TD element to have an attribute style initialized to border-style: solid. Without that, setting border color of a TD won't work. Is this known bug? How do I set the border color without having to set style attribute as well as the initialization value? I know another trick of setting the class attribute instead of setting the border color directly. Is this an indication that somehow TD hates having its border color set dynamically? Is this known as well? The problematic code is below (the goal is find out why setting the border color of simple truth 1 does not work while simple truth 3 works when I employ the trick described above): <html> <head> <title>Quirks FF 3.0.18</title> <style type="text/css"> table { border-collapse: collapse; } </style> <script type="text/javascript"> function changeBgColor() { document.getElementById('simple').style.backgroundColor='yellow'; document.getElementById('simple2').style.backgroundColor='yellow'; document.getElementById('simple3').style.backgroundColor='yellow'; } function quirk(id) { var x = document.getElementById(id); x.style.border = '2px solid red'; } </script> </head> <body> <input type="button" onclick="changeBgColor()" value="Change background color"/> <input type="button" onclick="quirk('simple')" value="Change border color 1"/> <input type="button" onclick="quirk('simple2')" value="Change border color 2"/> <input type="button" onclick="quirk('simple3')" value="Change border color 3"/> <table> <tr><td id="simple">Simple truth 1</td></tr> </table> <table> <tr><td><span id="simple2">Simple truth 2</span></td></tr> <table> <tr><td id="simple3" style="border-style: solid">Simple truth 3</td></tr> </table> </body> </html>

    Read the article

  • Extracting dates from html meta data in FAST-ESP

    - by Neil
    During document processing I want to extract all dates from html meta data and then identify the latest date which will be used to populate a date field (dtgeneric1). <meta name="OriginalPublicationDate" content="2010/04/21 12:06:36" /> <meta name="LastModificationDate" content="2010/04/22 14:10:16" /> + other non-date meta data Inspection using spy stages shows that our pipeline already adds meta_* attributes but the meta data names will be different across documents from different sources. #### ATTRIBUTE meta_originalpublicationdate <class 'docproc.DocumentAttributes.TextChunks'>: 2010/04/21 12:06:36 #### ATTRIBUTE meta_lastmodificationdate <class 'docproc.DocumentAttributes.TextChunks'>: 2010/04/22 14:10:16 + other non-date meta attributes Ideally we would like to pass all the meta_* attributes to a Python stage and use that to work out which are dates and which is the largest but there seems to be no way of specifying "all meta attributes" as input. Has anyone done something similar and can offer any advice on the best way to do this. Thanks Neil

    Read the article

  • Customizing an item's view in SharePoint Designer

    - by agnieszka
    I've created a list called Newsletters (columns: Title, Date and News - a multi lookup to a News list), and a DataFormWebPart displaying an item from this list. Now I'm modifing the XSLT transformation to change the displayed view. At the moment an item is simply displayed with its Title, Date and News attributes, where News attribute is displayed as a list of News items titles - this is the default. Instead of the titles, I would like to also display these news' Content. The problem is that I have no idea how to get to these elements. The News attribute is being referred in xslt simply as <xsl:value-of select="@News"/> and I can't get to the elements that lie behind it. Any suggestions on how I can do it?

    Read the article

  • Problem in populating a dictionary using Enumerable.Range()

    - by Newbie
    If I do for (int i = 0; i < appSettings.Count; i++) { string key = appSettings.Keys[i]; euFileDictionary.Add(key, appSettings[i]); } It is working fine. When I am trying the same thing using Enumerable.Range(0, appSettings.Count).Select(i => { string Key = appSettings.Keys[i]; string Value = appSettings[i]; euFileDictionary.Add(Key, Value); }).ToDictionary<string,string>(); I am getting a compile time error The type arguments for method 'System.Linq.Enumerable.Select(System.Collections.Generic.IEnumerable, System.Func)' cannot be inferred from the usage. Try specifying the type arguments explicitly. Any idea? Using C#3.0 Thanks

    Read the article

  • Accessing Active Directory Role Membership through LDAP using SQL Server 2005

    - by David Neale
    I would like to get a list of Active Directory users along with the security groups they are members of using SQL Server 2005 linked servers. I have the query working to retrieve records but I'm not sure how to access the memberOf attribute (it is a multi-value LDAP attribute). I have this temporary to store the information: DROP TABLE #ADUSERGROUPS CREATE TABLE #ADUSERGROUPS ( sAMAccountName varchar(30), UserGroup varchar(50) ) Each group/user association should be one row. This is my SELECT statement: SELECT sAMAccountName,memberOf FROM OpenQuery(ADSI, '<LDAP://hqdc04/DC=nt,DC=avs>; (&(objectClass=User)(sAMAccountName=9695)(sn=*)(mail=*)(userAccountControl=512)); sAMAccountName,memberOf;subtree') I get this error msg: OLE DB error trace [OLE/DB Provider 'ADSDSOObject' IRowset::GetData returned 0x40eda: Data status returned from the provider: [COLUMN_NAME=memberOf STATUS=DBSTATUS_E_CANTCONVERTVALUE], [COLUMN_NAME=sAMAccountName STATUS=DBSTATUS_S_OK]]. Msg 7346, Level 16, State 2, Line 2 Could not get the data of the row from the OLE DB provider 'ADSDSOObject'. Could not convert the data value due to reasons other than sign mismatch or overflow.

    Read the article

  • AD Stopping a Script and Writing a Value to a User's AD Account PPT Presentation

    - by Steven Maxon
    ‘This will launch the PPT in a GPO Dim ppt Set ppt = CreateObject("PowerPoint.Application") ppt.Visible = True ppt.Presentations.Open "C:\Scripts\Test.pptx" ‘This is the batch file at the end of the PPT that records the date, time, computer name and username echo "Logon Date:%date%,Logon Time:%time%,Computer Name:%computername%,User Name:%username%" >> \\servertest\g$\Tracking\LOGON.TXT ‘This is what I need but can’t find: I need the script to check a value in the Active Directory user’s account in the Web page: attribute that would shut off the script if the user has already competed reading the presentation. Could be as simple as writing XXXX. I need the value XXXX written to the Active Directory user’s account in the Web page: attribute when they finish reading the presentation after they click on the bat file so the script will not run again when they log in.

    Read the article

  • Ruby on Rails Foreigner plugin not working for SQL Server

    - by Earlz
    Well, now that I've finally got my stupid ODBC stuff configured, I took a schema.rb file that I dumped from a Postgres database and did a db:schema:load on it in a Rails project configured for SQL Server. Well, it sets up all the schema in the SQL Server database except for a minor detail: No foreign keys are created. The rake command doesn't show any errors and does say it is adding foreign keys. But they don't actually get added. This is the last bit from the command: -- add_foreign_key("workhistoryform", "form", {:name=>"workhistoryform_form_rid_fkey", :column=>"form_rid", :primary_key=>"form_rid"}) -> 0.0002s -- initialize_schema_migrations_table() -> 0.0092s -- assume_migrated_upto_version(0) -> 0.0942s [earlz@earlzarch avp_msql_migrations]$ So what is the problem? Does the Foreigner plugin not work in SQL Server? If it didn't I'd expect to see an error or something...

    Read the article

  • Instantiating a context in LINQ to Entities

    - by Jagd
    I've seen two different manners that programmers approach when creating an entity context in their code. The first is like such, and you can find it all over the MSDN code examples: public void DoSomething() { using TaxableEducationEntities context = new TaxableEducationEntities()) { // business logic and whatever else } } The second is to create the context as a private attribute in some class that encapsulates your business logic. So you would have something like: public class Education_LINQ { private TaxableEducationEntities context = new TaxableEducationEntities(); public void DoSomething() { var result = from a in context.luAction select a; // business logic and whatever else } } Which way is more efficient? Assume that you have two methods, one called DoSomething1() and another called DoSomething2(), and both methods incorporate the using statement to open the context and do whatever with it. Were you to call one method after the other, would there be any superfluous overhead going on, since essentially both methods create the context and then clean it up when they're done? As opposed to having just one private attribute that is created when a class object is instantiated, and then in turn cleaned up when the object goes out of scope?

    Read the article

  • ASP.NET MVC SSL POST Error

    - by RyanFetz
    I have a Logon page in a MVC (1.0) application that I am securing with SSL, I have an attribute that inspects the request for the page and redirects to a https uri when it is requested with http. This all works, however when I post the form content i get the following error: The parameters dictionary contains a null entry for parameter 'rememberMe' of non-nullable type 'System.Boolean' for method 'System.Web.Mvc.ActionResult LogOn(System.String, System.String, Boolean, System.String)' in 'DAC.US.Web.Portal.Controllers.AccountController'. To make a parameter optional its type should be either a reference type or a Nullable type. Parameter name: parameters here is the controller code... // // GET: /Account/LogOn [RequiresSSL] public ActionResult LogOn(string ReturnUrl) { if (TempData["Message"] != null) ViewData["Message"] = TempData["Message"]; TempData["Message"] = null; ViewData["ReturnUrl"] = ReturnUrl ?? "/Home"; return View(); } Again, the RequireSSL Attribute works, but the POST from that SSL uri does not. What is not working?

    Read the article

  • backgroundDisabledColor error when upgrading from Flex3 to FlashBuilder 4

    - by DShultz
    I've upgraded a FlexBuilder3 project to FlashBuilder4, and I am seeing many compilation errors regarding unsupported tag attributes: The style 'backgroundDisabledColor' is only supported by type 'mx.controls.TextInput' with the theme(s) 'halo' Here is the offending mxml element: <mx:TextInput x="245" y="86" id="code1" maxChars="15" change="enableButton(event)" cornerRadius="9" borderStyle="solid" backgroundDisabledColor="#7977b6" /> ...what is the best workaround for this particular error? I was able to easily resolve a similar error with the "backgroundColor" attribute by changing it to "contentBackgroundColor", and was hoping there was a simple workaround for backgroundDisabledColor as well. I realize I can apply a css style, but I'd rather have a simpler solution as there are many many other attribute errors similar to this one.

    Read the article

  • string comparison xslt sheet

    - by dbomb101
    I am trying to compare a value which was grabbed using the get method in a form and then passed into a xslt sheet. I named the string variable passed in browse. I want to check if the variable browse has a string value browse. the code is below <xsl:if test="$browse = 'browse' "> <A> <xsl:attribute name="href">searchPage.php?search=<xsl:value-of select="$search" />&amp;browseButton=Browse&amp;XML=Xml&amp;page=<xsl:value-of select="number($Page)-1"/>&amp;pagesize=<xsl:value-of select="$PageSize"/></xsl:attribute> &lt;&lt;Prev </A> </xsl:if>

    Read the article

  • Linq : problem with primary key

    - by Nickson
    I get the following error message The table/view 'TABLE1' does not have a primary key defined and no valid primary key could be inferred. This table/view has been excluded. To use the entity you will need to review your schema, add the correct keys and uncomment it when I try to add a view to an Entity Data Model. For testing, I have created a very simple view and I still get the error. below is the view definition SELECT DISTINCT TOP (100) PERCENT MIN(id) AS Expr4, MIN(EmpNo) AS Expr1, MIN(Name) AS Expr2, MIN(Category) AS Expr3 FROM dbo.MYView1 GROUP BY id does any one know of a simple work around. I have looked at this thread http://stackoverflow.com/questions/745341/can-ms-sql-views-have-primary-and-foriegn-keys but in my scenario, what is recommended is not applicable. If I could only have the view added to the Model.

    Read the article

  • How to change which item is “outlined” in a ListBox without changing the selection?

    - by Timwi
    How do you change which item is “outlined” in a ListBox? See the following screenshot for clarification: Background: I want to have a standard multi-select listbox that works normally. Unfortunately, the Windows Forms ListBox (with SelectionMode.MultiExtended) is not fully functional. The missing functionality is that it doesn’t let you select a disjoint set of items by using Ctrl+Arrow keys and Ctrl+Space. (Try it in Windows Explorer to see how it’s supposed to work.) I am trying to subclass ListBox and add this missing functionality. To this end, I intend to respond to Ctrl+Arrow keys in the OnKeyDown protected method, but in order to do so, I need to be able to move the outline without changing the set of selected items. How do I do that?

    Read the article

  • When functionalities of html attributes and css styles overlap

    - by AspOnMyNet
    1) If inside CSS file we specify the following style: .td { text-align:center; } While in a Html file we have <td align=”right” … > then value set in CSS file will take precedence over an inline html attribute and thus elements contained inside <td> cell will be aligned to the center. a) Is same true for all html attributes? Meaning if a CSS rule and an html attribute functionalities overlap , will the CSS rule always take precedence? BTW – I know we should usually prefer using CSS rules vs html attributes thanx

    Read the article

  • Mysql CASE - WHEN - THEN - returning wrong data type (blob)

    - by Jack
    Hi there. Im creating customizable product attributes in a web store - each attribute can have different type of data, each data type is stored in a separate column using corresponding mysql datatype. I Have a query like: SELECT products.id AS id, products.sku AS sku, products.name AS name, products.url_key AS url_key, attributes.name AS attribute, CASE WHEN `attribute_types`.`type` = 'text' THEN product_attribute_values.value_text WHEN `attribute_types`.`type` = 'float' THEN product_attribute_values.value_float WHEN `attribute_types`.`type` = 'price' THEN product_attribute_values.value_float WHEN `attribute_types`.`type` = 'integer' THEN product_attribute_values.value_integer WHEN `attribute_types`.`type` = 'multiple' THEN product_attribute_values.value_text WHEN `attribute_types`.`type` = 'dropdown' THEN product_attribute_values.value_text WHEN `attribute_types`.`type` = 'date' THEN product_attribute_values.value_date WHEN `attribute_types`.`type` = 'textarea' THEN product_attribute_values.value_textarea END as value from (...) Now, the problem is that when attribute_types.type equals to ?some-type? i want it to return a value as it's stored in product_attribute_values table. Currently I get BLOb every time. Should I use type-casting or there's some behind-the-scene magic that I dont know about, OR maybe there's some better alternative ?

    Read the article

  • What does this rake db:seed error mean?

    - by Kenji Kina
    I've been trying to solve this problem for a couple of hours but I can't seem to understand what's going on. I'm using Rails 3 beta, and want to seed some data to the database. However, when I try to seed some values through db:seed, I get this error: rake aborted! Attribute(#81402440) expected, got Array(#69024170) The seeds.rb is: DataType.delete_all DataType.create( :name => 'String' ) And I got these classes: class DataType < ActiveRecord::Base has_many :attributes end class Attribute < ActiveRecord::Base belongs_to :data_types end While the migration definition for DataType is merely: class CreateDataTypes < ActiveRecord::Migration def self.up create_table :data_types do |t| t.string :name t.timestamps end end def self.down drop_table :data_types end end Can anyone tell me what I'm doing wrong?

    Read the article

  • Python: convert buffer type of SQLITE column into string

    - by Volatil3
    I am new to Python 2.6. I have been trying to fetch date datetime value which is in yyyy-mm-dd hh:m:ss format back in my Python program. On checking the column type in Python I get the error: 'buffer' object has no attribute 'decode'. I want to use the strptime() function to split the date data and use it but I can't find how to convert a buffer to string. The following is a sample of my code (also available here): conn = sqlite3.connect("mrp.db.db", detect_types=sqlite3.PARSE_DECLTYPES) cursor = conn.cursor() qryT = """ SELECT dateDefinitionTest FROM t WHERE IDproject = 4 AND IDstatus = 5 ORDER BY priority, setDate DESC """ rec = (4,4) cursor.execute(qryT,rec) resultsetTasks = cursor.fetchall() cursor.close() # closing the resultset for item in resultsetTasks: taskDetails = {} _f = item[10].decode("utf-8") The exception I get is: 'buffer' object has no attribute 'decode'

    Read the article

  • understanding semcor corpus structure h

    - by Sharmila
    I'm learning NLP. I currently playing with Word Sense Disambiguation. I'm planning to use the semcor corpus as training data but I have trouble understanding the xml structure. I tried googling but did not get any resource describing the content structure of semcor. <s snum="1"> <wf cmd="ignore" pos="DT">The</wf> <wf cmd="done" lemma="group" lexsn="1:03:00::" pn="group" pos="NNP" rdf="group" wnsn="1">Fulton_County_Grand_Jury</wf> <wf cmd="done" lemma="say" lexsn="2:32:00::" pos="VB" wnsn="1">said</wf> <wf cmd="done" lemma="friday" lexsn="1:28:00::" pos="NN" wnsn="1">Friday</wf> <wf cmd="ignore" pos="DT">an</wf> <wf cmd="done" lemma="investigation" lexsn="1:09:00::" pos="NN" wnsn="1">investigation</wf> <wf cmd="ignore" pos="IN">of</wf> <wf cmd="done" lemma="atlanta" lexsn="1:15:00::" pos="NN" wnsn="1">Atlanta</wf> <wf cmd="ignore" pos="POS">'s</wf> <wf cmd="done" lemma="recent" lexsn="5:00:00:past:00" pos="JJ" wnsn="2">recent</wf> <wf cmd="done" lemma="primary_election" lexsn="1:04:00::" pos="NN" wnsn="1">primary_election</wf> <wf cmd="done" lemma="produce" lexsn="2:39:01::" pos="VB" wnsn="4">produced</wf> <punc>``</punc> <wf cmd="ignore" pos="DT">no</wf> <wf cmd="done" lemma="evidence" lexsn="1:09:00::" pos="NN" wnsn="1">evidence</wf> <punc>''</punc> <wf cmd="ignore" pos="IN">that</wf> <wf cmd="ignore" pos="DT">any</wf> <wf cmd="done" lemma="irregularity" lexsn="1:04:00::" pos="NN" wnsn="1">irregularities</wf> <wf cmd="done" lemma="take_place" lexsn="2:30:00::" pos="VB" wnsn="1">took_place</wf> <punc>.</punc> </s> I'm assuming wnsn is 'word sense'. Is it correct? What does the attribute lexsn mean? How does it map to wordnet? What does the attribute pn refer to? (third line) How is the rdf attribute assigned? (again third line) In general, what are the possible attributes?

    Read the article

  • [Struts2+tiles] How can I make title dynamically?

    - by Lee Domin
    I'm developing BBS in struts2 and tiles(2) framework. I want to push a value in ActionSupport class and pop the value in layout.jsp of tiles. but i just keep failing to access to the value. I will explain my works step by step. 1) Users click a link to view an article at list page. And BoardView class will be called as defined in struts.xml --list.jsp-- <a href="view_board?num=${num}"> ${ subject } </a> --struts.xml-- <action name="View_board" class="board.BoardView"> <result type="tiles">board.view</result> </action> 2)Action class will put title into the value stack... right? --BoardView class-- public class BoardView extends ActionSupport private String title; public void Execute() throws Exception { ... setTitle(board.getSubject()); return SUCCESS; } ... (setter and getter of title) 3) As ActionClass returns SUCCESS, it will go to tiles definition named board.view --struts.xml-- <action name="View_board" class="board.BoardView"> <result type="tiles">board.view</result> </action> 4)Here's the tiles-def.xml and the problem. I think the value of 'title' can't be popped from value stack. ==tiles-def.xml== <definition name="board.view" extends="layout"> <put-attribute name="title" value="%title" /> <put-attribute name="body" value="/board/view.jsp" /> </definition> (I can't indent with tags... sorry) Here's the layout.jsp ==layout.jsp== ... <title><tiles:getAsString name="title" /></title> ... I tried to replace the value attribute to %{title}, $title and ${title}. But nothings worked out. Web Browser just shows the string itself($title). I don't know what to do... please help me. I hope you all understand my works despite of my bad explanation.

    Read the article

  • How to secure licensekey generation

    - by Jakob Gade
    Scenario, simplified for brevity: A developer creates an application for a customer. The customer sells this app to end-users. The app requires a license key to run, and this key is generated by the customer for each end-user with a simple tool created by the developer. The license key contains an expiry date for the license and is encrypted so the end-user can’t tamper with it. The problem here is that the developer (or anybody who has a copy of the license key generator) can easily create valid license keys. Should this generator fall into the wrong hands, it could spell disaster for the customers business. Ideally, the customer would have to use a password to create new license keys. And this password would be unknown to the developer, and somehow baked into the decryption algorithm in the application so it will fail if an attempt to use an unauthorized key is made. How would you implement a solution for this problem that is both transparent and secure?

    Read the article

  • Scala method where type of second parameter equals part of generic type from first parameter

    - by ifischer
    I want to create a specific generic method in Scala. It takes two parameters. The first is of the type of a generic Java Interface (it's from the JPA criteria query). It currently looks like this: def genericFind(attribute:SingularAttribute[Person, _], value:Object) { ... } // The Java Interface which is the type of the first parameter in my find-method: public interface SingularAttribute<X, T> extends Attribute<X, T>, Bindable<T> Now i want to achieve the following: value is currently of type java.lang.Object. But I want to make it more specific. Value has to be the of the same type as the placeholder "_" from the first parameter (and so represents the "T" in the Java interface). Is that somehow possible, and how? BTW Sorry for the stupid question title (any suggestions?)

    Read the article

  • Keyboard with normal layout just without numpad? [closed]

    - by Pla
    Do you know any keyboard that does not have a numpad and, at the same time, is not a compact keyboard? I type a lot and I enjoy using standard full sized keyboards. I am annoyed by the presence of the numpad. I've never used it; it just wastes desktop space! All I could find are (even more annoying) compact keyboards. Sadly those keyboards are so compact that cram the arrow keys and the page up/down keys in a very little space. So, does anyone know a keyboard with a normal layout but without the numpad?

    Read the article

  • Why is my new ID always "1"

    - by normalocity
    I have a parent-child relationship between two objects. Parent :has_many :children Child :belongs_to :parent When creating a new parent, in the same controller, I'm creating the child. @mom = Parent.new @child = Child.new @mom.children << @child That all seems to go okay, but this parent has one more attribute - this parent has a favorite child @mom.favorite_child = @child Seems like this should work, except let's say that this is the 61st child in the database, so it gets an ID of 61 (and I know this is happening, because when I check the database, the child record has an ID of 61). For some reason, when I assign the @child to the parent's "favorite_child" attribute, "favorite_child" gets set to "1" - when I need it to be set to "61". Clues?

    Read the article

< Previous Page | 143 144 145 146 147 148 149 150 151 152 153 154  | Next Page >