Search Results

Search found 6420 results on 257 pages for 'mathieu parent'.

Page 97/257 | < Previous Page | 93 94 95 96 97 98 99 100 101 102 103 104  | Next Page >

  • Post and Comment with the same Model.

    - by xRobot
    I have created a simple project where everyone can create one or more Blog. I want to use this models for Post and for Comment: class Post_comment(models.Model): content_type = models.ForeignKey(ContentType) object_id = models.PositiveIntegerField(_('object ID')) content_object = generic.GenericForeignKey() # Hierarchy Field parent = models.ForeignKey('self', null=True, blank=True, default=None, related_name='children') # User Field user = models.ForeignKey(User) # Date Fields date_submitted = models.DateTimeField(_('date/time submitted'), default = datetime.now) date_modified = models.DateTimeField(_('date/time modified'), default = datetime.now) title = models.CharField(_('title'), max_length=60, blank=True, null=True) post_comment = models.TextField(_('post_comment')) markup = models.IntegerField(choices=MARKUP_CHOICES, default=DEFAULT_MARKUP, null=True, blank=True) if it is a comment the parent is not null. So in most case the text field will contain a little bit of text. Can I use this model for both Post and Comment ?

    Read the article

  • Correct CSS inheritance behavior for properties that aren't inherited?

    - by Chris
    So say we you have a CSS property that is not inherited by default. We'll call it "foo" and its default value is "black". Then we make the following html. <div id="div1" style="foo: red;"> <div id="div2"> <div id="div3" style="foo: inherit;"> </div> </div> </div> Since this property does not inherit by default, you'd think that in div2, "foo" must be "black" - the default value because it does not inherit by default. But ... in div3 should the value for "foo" inherit "black" from its parent that did not inherit foo, or should it inherit "red" from its grandparent because its parent did not specify foo? I need to know because I'm trying to implement something exactly to the spec.

    Read the article

  • C++ inheritance question

    - by user233973
    Hi guys, I have a C++ inheritance related question. I have a set of classes like this (I have not given the complete class structure coz I am lazy :) ). I want to access chiComponent class public methods using com pointer. How should I go about it? Note that I am having to change the object which "com" is pointing to in a lot of places. So I do not think I can have another chiComponent *ccom = <some_cast> com; ccom.chiComponentMethod() How should I go about it? class Component{ }; class chiComponent : public Component { public: void chiComponentMethod() { cout << "Hi! Chi component function called!!"; } } class parent { protected: Component *com; }; class child : public parent{ public: child() { com = new chiComponent(); } } Regards Arun

    Read the article

  • jquery get selected dropdownlist text

    - by mike
    Hi How can i get the selected text on a dropdowm, ive seen examples of how to do eg $('select option:selected').text() but looking at my code below, how can i modify it to work as the line alert($(this).parent().text()); gets all the list items as opposed to selected text $(document).ready(function () { $('.mutuallyexclusive').live("click", function () { checkedState = $(this).attr('checked'); $('.mutuallyexclusive:checked').each(function () { $(this).attr('checked', false); }); $(this).attr('checked', checkedState); alert($(this).parent().text()); }); });

    Read the article

  • How can I take zooming into account when a user touches a UIScrollView?

    - by Bill
    I have a UIImageView inside of a UIScrollView. The parent scroll view allows zooming and panning. When the user taps a point in the scroll view, I want to find the location in the raw image inside the UIImageView - i.e. I want the point after including any zooming and panning the user has done in the scroll view. Right now, I have a UIScrollView subclass called ForwardingScrollView that handles touch events and attempts to convert them into locations in the coordinate system of the child image view. I tried adding contentOffset to these points, tried multiplying them by zoomScale, and even tried doing both. I also tried calling [touch locationInView: self] and [touch locationInView: parent], but none of these methods correctly return the point that I clicked in the underlying image. What's the best way to do this? Thanks in advance.

    Read the article

  • Drupal removing javascript from Full HTML link

    - by Jen
    I am new to Drupal and am trying to create a node (let's call it child) that will only really be accessed when clicked on from another node (we'll call it parent). When closing the child window, I want to parent window to refresh. Outside of Drupal, that's easy: <a onclick="window.close(); window.opener.location.reload();" href="#">Click to close this window</a> However, when I type this into the body of a node using Full HTML, it still strips the onclick text from my post. How can I include javascript in the body of a node like this? Is there a special module I need. Thanks!

    Read the article

  • Trigger Event after values have been commited for validation purposes

    - by www.jefferyfernandez.id.au
    I have a Flex component with a form and on creationComplete, I load some data onto the form textInputs. After the Form TextInputs have got their values, I want to trigger an event so the Parent of the component can validate the values on the TextInputs and based on the validation results, I perform some enable/disable of other interfaces. I have the following dispatch code: this.dispatchEvent(new PersonalDetailsEvent(PersonalDetailsEvent.LOADED_DATA_EVENT)); The event is dispatched and is captured by the parent. But upon performing the validation, some TextInputs always fail the validation. I thought it could be because of a race condition and so I used callLater() with same results. So in the end I am now using a timer to dispatch the event which is not ideal. Does anyone have a solution to this problem. It is really annoying that a timer needs to be used for this scenario.

    Read the article

  • How to get text in QlineEdit when QpushButton is pressed in a string?

    - by esafwan
    I have given my code below, have problem in implementing a function I want the text in lineedit with objectname 'host' in a string say 'shost'. when the user click the pushbutton with name 'connect'.How do i do it? I tried and failed. How to implement this function? import sys from PyQt4.QtCore import * from PyQt4.QtGui import * class Form(QDialog): def __init__(self, parent=None): super(Form, self).__init__(parent) le = QLineEdit() le.setObjectName("host") le.setText("Host") pb = QPushButton() pb.setObjectName("connect") pb.setText("Connect") layout.addWidget(le) layout.addWidget(pb) self.setLayout(layout) self.connect(pb, SIGNAL("clicked()"),self.button_click) self.setWindowTitle("Learning") def button_click(self): #i want the text in lineedit with objectname #'host' in a string say 'shost'. when the user click # the pushbutton with name connect.How do i do it? # I tried and failed. How to implement this function? app = QApplication(sys.argv) form = Form() form.show() app.exec_() Now how do i implement the function "def button_click(self):" ? I have just started with pyQt!

    Read the article

  • Multiple column foreign key contraints

    - by eugene4968
    I want to setup table constraints for the following scenario and I’m not sure how to do it or if it’s even possible in SQL Server 2005. I have three tables A,B,C. C is a child of B. B will have a optional foreign key(may be null) referencing A. For performance reasons I also want table C to have the same foreign key reference to table A. The constraint on table C should be that C must reference its parent (B) and also have the same foreign key reference to A as its parent. Anyone have any thoughts on how to do this?

    Read the article

  • how to force nhibernate to set the foreign key of the child item?

    - by npeBeg
    i have a collection in the mapping: <bag name="Values" cascade="all-delete-orphan" lazy="false" inverse="true"> <key column="[TemplateId]"/> <one-to-many class="MyNamespace.Value, MyLib"/> </bag> the Value object has a foreign key [TemplateId]. both entities has their generator set to "identity". when i call session.Save() for the parent Template object, the Value objects has their [TemplateId] (the foreign key) set to zero, so an SQL exception appears. how do i forse nhibernate to set the FK value for the child items to the value of the inserted parent object?

    Read the article

  • [as3] Movieclip.width returns higher value than Movieclip stage on Width.

    - by Sawrb
    I have a Movieclip on stage with nested movieclips inside. All referenced at 0,0. None of the child movieclips load any dynamic content, animate or have Masked Layers. It does have an input textfield in one of the child MCs. The parent MC shows 280 px width, while it returns 313 px with a .width trace. There is no code that alters the .width value of the parent MC at run-time. And the ParentMC on stage is not scaled (it is at 100% width/height). Any pointers, to what could be the reasons for the discrepancy in .width values on stage and on run-time? Its breaking the scaling code that follows.

    Read the article

  • Expand Expandable Listview in android on button Click

    - by user3146145
    I am implementing expandable list view with its custom adapter. The group element needs to have 2 buttons, first as a parent group element and a button below it. My problem is, I want to expand the list view on click of the button below instead of the group element. Also, The group element onClick needs to call another activity. I can disable the expanding of the expandablelistview by `mainExpListView.setOnGroupClickListener(new OnGroupClickListener() { @Override public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) { return false; }` So my questions: Is there any way to disable the group element and get it to perform other functions (Like navigate to another activity?) How to set an onclick method on them bottom image to expand? Thank you.

    Read the article

  • Codeigniter - selecting children and parents from db

    - by Tomek Buszewski
    I want to pull from my database records corresponding to parent_id, like this: function getChildren($id, $parent_id) { $q = $this->db->select('id, name, slug, plat'); $q = $this->db->from('games'); $q = $this->db->where('parent_id',$id); $q = $this->db->or_where('id',$parent_id); $q = $this->db->get(); return $q->result_array(); } It - if it's a children game - get parent_id and search for a game with such id and for other games that has parent_id same as this one. If it's the parent game, it only looks for games with parent_id same as it's id. The problem is... it's not always working. I have four games in db: id | parent_id | title 15 | 0 | Abe 19 | 15 | Abe 20 | 0 | RE2 21 | 20 | RE2 DS First two works, last two - only children (id = 21) shows parent.

    Read the article

  • How to use condition in a TestGen4Web script for a child popup window?

    - by GotoError
    I have TestGen4Web script for automating testing on a web-based user interface that has a popup window (hey i didn't write that ui..). In order to write a complete test script that branches the flow based on the some presence of some content in the popup window, I need to write a simple if condition that does something like if document.getElementById("xyz").value - that will run on the popup window and not the parent window. Any ideas on how to accomplish this? currently, the condition fails because it runs on the parent window. Also, how to extract some text from the dom and spit it out to a file at the end of the test?

    Read the article

  • XPath select specific child elements

    - by Cool
    Hi, If I have XML tree like this- <Parent> <Image Name="a"/> <Image Name="b"/> <Child> <Image Name="c"/> <Image Name="d"/> </Child> <Image Name="e"/> </Parent> I want to select all <Image\> nodes except those listed inside <Child\> node. Currently I am using query to select all Image nodes, - xElement.XPathSelectElements("//ns:Image", namespace); Thanks in advance.

    Read the article

  • Analog of Java Form Layout in Qt

    - by Narek
    Once I have programmed GUI with Java and have used Form Layouts. Form layout (if I am not mistaken that is from SWT library) made possible to give right, left, top and bottom adges of any GUI element (widget) with respect to other widgets in the same widget (parent widget) or with respect to the adges of parent widget. So it was possible to control the future of widgets that are inside of another one, when that "another widget" is being resized. In Qt I have find the QFormLayout which is similar to Java one, but seems I can't handle with widgets as flexible in terms of relative positioning, as it was with Java's Form Layout. So are there any other means to give a widget position with respect to the others (without overloading resizeEvent function) as that was in Java? Thanks.

    Read the article

  • Core Data-Linking one-to-many relationships

    - by Stelmate
    I have a one-to-many relationship where each department has many employees. When I create a new employee object I just link it to the parent department manually by setting the property to the instance of the department I have fetched from my fetch request. However, this seems to be improper because when I try to access the set of employees from the department by simply accessing the .employees property on my department object instance it returns a 0 count. Isn't the fault suppose to fire once I access a property? Am I linking my parent/child objects incorrectly?

    Read the article

  • Why activity result code is diffrent then I expected

    - by Fisher
    I have 2 activities. In child activity i have put something like that in onPause(): if (isFinishing()) { final Intent intent = new Intent(); intent.putExtra(SOME_DATA, value); setResult(RESULT_OK, intent); Log.i("test", "Result set to RESULT_OK"); } In parent activity i check resultCode when child activity is destroyed, and this is what i have noticed: If i destroy child activity by some action (in some condition i invoke finish()), then resultCode is RESULT_OK But when i destroy by pressing return key (i works only in emulator so its ESC) who kills activity, then resultCode read in parent onActivityResult method equals 0 (RESULT_CANCELD). "test" log read in each case is the same.

    Read the article

  • How to save an order (permutation) in an sql db

    - by Bendlas
    I have a tree structure in an sql table like so: CREATE TABLE containers ( container_id serial NOT NULL PRIMARY KEY, parent integer REFERENCES containers (container_id)) Now i want to define an ordering between nodes with the same parent. I Have thought of adding a node_index column, to ORDER BY, but that seem suboptimal, since that involves modifying the index of a lot of nodes when modifying the stucture. That could include adding, removing, reordering or moving nodes from some subtree to another. Is there a sql datatype for an ordered sequence, or an efficient way to emulate one? Doesn't need to be fully standard sql, I just need a solution for mssql and hopefully postgresql EDIT To make it clear, the ordering is arbitrary. Actually, the user will be able to drag'n'drop tree nodes in the GUI

    Read the article

  • Multiple Linked List in C

    - by LuckySlevin
    I have a problem about Linked Lists. I already know how to create structures and linked list. But now I have to create arbitrary number of linked list which are also be kept in another structure. Which means : struct list{int x, struct list *next; }; struct parent{int x, struct list *head, struct parent *next;} And after lists are created when i enter this input for example "123134 linked list should look like : 1 - 2 - 3 - 4 And for example 1 will contain 2-3 list inside of it, 3 will contain 1-4 list inside of it. I need a starting point and a spark from you. So how can i do this?

    Read the article

  • Sharepoint 2010 Calendar Event Receiver

    - by user521682
    I have been tasked with creating a calendar in a root site that get's updated from child site calendar events. I am able to access the Calendar List from the parent site in the child site's to add an event. However, I'm having trouble finding a way to create a uniqueIdentifier for the event so that when the child calendar's event is updated or deleted, the parent site calendar get's updated as well. The ListItem ID field appears to be only unique among the site. I did find a UniqueItemId field, but apparantly it's read-only in the SP LIstitem object. Can someone please give me some guidance here? Many thanks!

    Read the article

  • Sending data between activities within my app?

    - by user246114
    Hi, I have a TabActivity, and the tabs point to sub activities. Is there a way I can send a 'message' to those child activities? I just want to pass a string across, not sure if this is possible. I have some data being fetched by the parent TabActivity, and the child tabs can't do anything useful until the parent is done fetching. When fetching is complete, I'd like to pass that data to the child activities so they can do something useful with it. Notmally I'd set the data to be passed in the Intent when first creating the activity, but in this case I can't do that. Thanks

    Read the article

  • how to return value from groovy to java

    - by Sid
    Hi I am very new to groovy and having trouble with some parts. I have a jsp page tied to a servlet that runs groovy scripts. I am able to get to the groovy script from the servlet. But after the script runs how do I return the response from the groovy script back to the servlet to be displayed in the jsp page? My java servlet code is as follows: File file = new File("TestScript.groovy"); ClassLoader parent = getClass().getClassLoader(); GroovyClassLoader loader = new GroovyClassLoader(parent); Class groovyClass = loader.parseClass(file); Object[] args = {}; GroovyObject groovyObject = (GroovyObject) groovyClass.newInstance(); groovyObject.invokeMethod("runTest", args);

    Read the article

  • Entity diagram with tables that have foreign keys that point to a non-PK column do not show relation

    - by Jason Coyne
    I have two tables parent and child. If I make a foreign key on child that points to the primary key of parent, and then make an entity diagram, the relationship is shown correctly. If I make the foreign key point to a different column, the relationship is not shown. I have tried adding indexes to the column, but it does not have an effect. The database is sqlite, but I am not sure if that has an effect since its all hidden behind ADO.net. How do I get the relationship to work correctly?

    Read the article

< Previous Page | 93 94 95 96 97 98 99 100 101 102 103 104  | Next Page >